Given an undirected weighted graph where there is an edge between every pair of distinct vertices of nonnegative integer weight, let
Given a sequence of integers
Constraints
There is no opportunity for partial credit on this problem.
Input Specification
The first line contains a single integer,
Each of the next
Output Specification
Output YES
if it is possible to construct such a graph. Output NO
otherwise.
Sample Input 1
Copy
3
1
1
2
Sample Output 1
Copy
YES
Sample Input 2
Copy
3
1
1
3
Sample Output 2
Copy
NO
Comments
It doesnt make sense if you only have one node but you cannot make a graph