While searching in the garbage cans, Jean found a sequence of positive integers. Because he has no use for this, he gifted it to Nicusor Gioconda, and gave him a challenge too.
Nicusor has to chose pairwise distinct substrings of length such that every index is taken at least once. If he will give a correct partitioning, he will get the ultimate prize: the magical chicken wing!
In this problem, we consider that a substring is a contiguous subset of indices .
Because he is far better at singing than he is at solving problems, he asks for your help.
Input data
First line will contain a single number () - the length of the sequence.
The next line contains a sequence of positive values ().
Output data
The first line will contain a string that is either YES
or NO
, that represents the existence of a correct partitioning.
Constraints and clarifications
- For point it is guaranteed that ;
- For the other points we have .
Example 1
stdin
5
1 2 1 2 3
stdout
YES
Explanation
For the first example, a valid partitioning is corresponding to the indices .
Example 2
stdin
5
1 2 2 2 2
stdout
NO