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.
Constraints
Input Format
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 Format
Output "YES" if is an involution. Otherwise, output "NO".
Sample Input
2
2 1
Sample Output
YES
Explanation
Since, and and .
Hence, is an involution.