Amy bought her friends each a gift, and wrapped them all. However, in her haste, she may have labelled them wrong! She labelled all of the gifts with integers , but she may have made a mistake and forgotten a friend, or given one friend multiple gifts. Can you help her?
Constraints
Subtask 1 [6/15]
Subtask 2 [9/15]
No additional constraints.
Input Specification
The first line will contain , the number of friends Amy has.
The next line will contain space-separated integers , the labels on the gifts.
Output Specification
If there are no duplicate labels and each friend from to received a gift, output YES
.
Otherwise, output NO
.
Sample Input 1
4
4 2 3 1
Sample Output 1
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
10
1 3 2 4 5 8 6 3 7 10
Sample Output 2
NO
Explanation for Sample Output 2
Note that friend number did not receive a gift.
Comments