An array $$$a_1 \dots a_n$$$ is simple if you can negate certain elements to make the array sum to zero. For example, the array $$$[1, 1, 2]$$$ is simple, since you can negate the third element making the array $$$[1, 1, -2]$$$, which sums to zero.
Given an array such that each element is an integer $$$0$$$, $$$1$$$, or $$$2$$$, determine if this array is simple.
The first line contains a single integer $$$n$$$, representing the number of elements in the array. ($$$1 \leq n \leq 10^5$$$)
The next line contains $$$n$$$ space-separated integers describing $$$a_1 \dots a_n$$$. ($$$0 \leq a_i \leq 2$$$)
Print YES if the array is simple. Otherwise, print NO.
Note that capitalization doesn't matter; If the answer was YES and you printed Yes, your code would still be accepted.
3 1 1 2
YES
4 0 2 2 2
NO
In sample case 1, you can negate the third element making the array $$$[1, 1, -2]$$$, which sums to zero.
In sample case 2, it can be proven that no matter which elements you negate, the array does not sum to zero.