Amy bought her
Constraints
Subtask 1 [6/15]
Subtask 2 [9/15]
No additional constraints.
Input Specification
The first line will contain
The next line will contain
Output Specification
If there are no duplicate labels and each friend from YES
.
Otherwise, output NO
.
Sample Input 1
Copy
4
4 2 3 1
Sample Output 1
Copy
YES
Explanation for Sample Output 1
Each friend received a gift, and no friend received more than one gift, so Amy labelled her gifts correctly.
Sample Input 2
Copy
10
1 3 2 4 5 8 6 3 7 10
Sample Output 2
Copy
NO
Explanation for Sample Output 2
Note that friend number
Comments