Question
Strictly Increasing Array

In a vibrant village, Kiran was given an array A of size N. Intrigued by its arrangement, Kiran pondered whether he could rearrange the elements to form a strictly increasing sequence. In each move, he could swap any two elements in the array. With the option to make as many moves as he needed (including none at all), Kiran set out to determine if it was possible to transform the array into a strictly increasing one. Can you help Kiran figure out if he can achieve this?

Input
The first line of the input contains a single integer N.
The second line of the input contains N space separated integers.

Constraints
1 ≤ N ≤ 105
1 ≤ Ai ≤ 106
Output
Print (without quotes) "YES", if you can make the array strictly increasing, else print "NO", without the quotes.
Example
Sample Input
5
5 9 4 5 3
Sample Output
NO
Explanation
After any number of moves, you cannot make this array strictly increasing.

Online