CF920C Swap Adjacent Elements

Description

You have an array $ a $ consisting of $ n $ integers. Each integer from $ 1 $ to $ n $ appears exactly once in this array. For some indices $ i $ ( $ 1

Input Format

The first line contains one integer $ n $ ( $ 2

Output Format

If it is possible to sort the array in ascending order using any sequence of swaps you are allowed to make, print YES. Otherwise, print NO.

Explanation/Hint

In the first example you may swap $ a_{3} $ and $ a_{4} $ , and then swap $ a_{4} $ and $ a_{5} $ .