Simple Path
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
A traveler set out on a journey across his homeland, visiting several cities and making brief stops in each. A path is considered simple if the traveler does not visit any city more than once.
Write a program to determine if the given path is simple.
Input
The first line contains an integer N — the number of stops on the journey (1 ≤ N ≤ 10000). The second line lists N integers, representing the cities where the traveler stopped, in the order of his visits. Each city is identified by an integer from 1 to 10^6.
Output
Print "YES" if the path is simple, otherwise print "NO".
Examples
Input #1
Answer #1
Submissions 851
Acceptance rate 58%