You are given an integer sequence of length .
You may perform the following operation any number of times(possibly, zero).
- Choose an integer such that , and swap and .
The indices of the sequence are -based. Determine whether it is possible to sort the sequence in nondecreasing order using only the given operations.
Input
The input is given in the following format.
Output
Print YES if the sequence can be sorted in nondecreasing order using only the allowed operations. Otherwise, print NO.
Constraints
- .
- ().
Subtasks
Samples
It is already sorted in non-decreasing order.
The sorted sequence is . However, You cannot perform an operation on , so its location is fixed at index . Thus, you cannot sort the given array.
Swap the st index and the rd index, then swap the nd index and the th index. The resulting sequence is .