You are given an integer sequence of length .
You may perform the following operation any number of times.
Choose two distinct indices and swap and . However, and must have the same parity. In other words, they must be both odd indices or both even indices.
The indices of the sequence are -based. Determine whether it is possible to sort the sequence in nondecreasing order using only the allowed 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
이미 비내림차순으로 정렬되어 있다.
정렬된 수열은 이다. 하지만 은 짝수 인덱스에 있고, 정렬된 수열에서는 홀수 인덱스에 있어야 한다. 인덱스의 홀짝성은 바꿀 수 없으므로 정렬할 수 없다.
번 인덱스와 번 인덱스를 교환하고, 번 인덱스와 번 인덱스를 교환하면 수열은 가 된다.
해설
관리자가 작성한 해설을 별도 페이지에서 볼 수 있어요.