Some error occured while loading page for you. Please try again.
Consider a function where is any set, and is a bijection.
Now, if then is called an involution. In other words, a function is called an involution if
In this task you're given a permutation .
Determine whether is an involution or not.
There are lines in the input.
The first line contains a single positive integer .
The second line contains space separated integers, the values of , respectively.
Output "YES" if is an involution. Otherwise, output "NO".
Since, and and .
Hence, is an involution.