#Q248. 「一本通 6.7 练习 3」取石子
「一本通 6.7 练习 3」取石子
Description
Alice and Bob, two good friends, are playing a stone-taking game again. At the beginning of the game, there are piles of stones arranged in a row. They take turns to make moves (Alice goes first), and in each move, they can choose one of the following rules:
- Take one stone from any pile;
- Merge any two piles of stones.
The player who cannot make a move loses. Alice wants to know if she has a winning strategy.
Input Format
The first line contains , the number of test cases.
For each test case, the first line contains ;
The next positive integers represent the number of stones in each pile.
Output Format
For each test case, output one line.
Output YES if Alice has a winning strategy, and NO otherwise.
Sample 1
3
3
1 1 2
2
3 4
3
2 3 5
YES
NO
NO
Constraints & Notes
For all test cases, .