410489: GYM104027 B Candies

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

B. Candiestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Master Yi, Mao mao and zyw are good friends. Today they received some candies feed from Mao mao's girlfriend. There are a total of $$$n$$$ packs of candies, and each pack contains $$$2$$$ or $$$3$$$ candies. Now zyw wants to test you, is there a division scheme so that all of them get the same amount of candies. Note that the entire package of candy cannot be taken apart for distribution.

Input

The first line of the input contains a single integer $$$T\ (1\le T\le 100)$$$ — the number of test cases. The description of test cases follows.

The first line of each test case contains the integer $$$n\ (1\le n\le 100)$$$ — the length of the packs of candies.

Then a single line follows, containing $$$n$$$ integers describing the array $$$a\ (2\le a_i\le 3)$$$ — the number of candies in each pack.

Output

For each test case output YES if all of them could get the same number of candies, or NO if no division satisfy the conditions.

ExampleInput
3
3
2 3 3
4
2 2 2 3
8
2 3 2 2 2 2 3 2
Output
NO
NO
YES

加入题单

算法标签: