EasyRating 900
Two Equal Halves?
Split the numbers into two groups (each number in exactly one group, a group may be empty) so both groups have the same sum. Every number is 1 or 2. Print YES or NO.
Input
n, then n numbers (each 1 or 2).
Output
YES or NO.
Sample 1
Input
2 1 1
Output
YES
Sample 2
Input
2 1 2
Output
NO
Output appears here