#115Easy
Is it a permutation
Time: 1 s · Memory: 256 MB
- Maps and sets
Statement
You are given an array of numbers. Is it a permutation of the numbers to , i.e. does each of occur exactly once (in any order)?
Input format
The first line contains (). The second line contains integers ().
Output format
YES if it is a permutation, NO otherwise.
Examples
Input
6 5 2 1 4 3 6
Output
YES
Input
3 1 2 2
Output
NO
Note
Two conditions: every number is within and none repeats. A set or a "seen" array of length is enough. In the second example repeats and is missing — .
