There are 3 piles of stone. Alice and Bob will take turns, and Alice will go first. In each round, you have to discard one pile and choose one other pile and split it into two non-empty piles. Whoever can't do it loses the game. Is it possible that Bob, the one who moves second, can win the game, assuming Alice and Bob both follow their optimal strategies?
Clarification: you don't have to split one pile into two piles with equal number of stones. For example, it is fine to split a pile of 5 stones into one pile of 2 stones and one pile of 3 stones. You can also split a pile of 5 stones into one pile of 1 stone and one pile of 4 stones.
Input Specification
The first line of the input consists of an integer denoting the number of cases.
In the following lines, each line contains three integers , separated by a single space, denoting the number of stones in the 3 piles at the start.
Output Specification
If assuming both players follow optimal strategy, Bob can win the game, then output YES
. Otherwise, output NO
.
Sample Input
4
1 1 1
2 2 2
1 2 3
2 3 4
Sample Output
YES
YES
NO
NO
Explanation
In the first sample case, Alice cannot move, so Bob will always win.
In the second sample case, after the first step you always end up with state (in some order), and then the only possibility is Bob will split the pile with 2 stones and end up with state . Then Alice cannot move, and Bob wins again.
In the third example, Alice can first discard the pile with 1 stone and split the pile with 2 stones, so you end up with . Then Bob can only discard the pile with 1 stone and split the pile with 3 stones, so Alice will start with . Then Alice will split the pile with 2 stones and Bob have to face , so if Alice plays optimally, Bob cannot win.
In the fourth example, Alice can first discard the pile with 4 stones and split the pile with 2 stones, which gives Bob . The rest of the argument is same, so Bob cannot win if Alice plays optimally.
Constraints
For all test cases, .
Scoring
There will be 25 test cases for this problem.
- Test case 1: .
- Test case 2: at least two of is 1.
- Test case 3: .
- Test case 4-6: .
- Test case 7-8: .
- Test case 9-10: .
- Test case 11-12: .
- Test case 13-14: .
- Test case 15-18: at least one of is odd.
- Test case 19-25: no additional constraints.
Comments