#Q247. 「一本通 6.7 练习 2」巧克力棒

「一本通 6.7 练习 2」巧克力棒

Description

Original problem from: BZOJ 1299

TBL and X are playing a game with chocolate bars. In each turn, a player can either take out a certain number of chocolate bars from the box or eat a positive integer length of a previously taken-out chocolate bar. TBL moves first, and the players alternate turns. The player who cannot make a move loses. They played a total of 10 rounds (each with a new box) using optimal strategies. Can you predict the outcomes?

Input Format

The input consists of 20 lines. The (2i-1)-th line contains a positive integer NiN_i, indicating the number of chocolate bars in the i-th round. The 2i-th line contains NiN_i positive integers Li,jL_{i,j}, representing the lengths of the chocolate bars in the i-th round.

Output Format

The output should consist of 10 lines. Each line should output YES or NO, indicating whether TBL will lose. If TBL loses, output NO; otherwise, output YES.

Sample 1

3
11 10 15
5
13 6 7 15 3
2
15 12
3
9 7 4
2
15 12
4
15 12 11 15
3
2 14 15
3
3 16 6
4
1 4 10 3
5
8 7 7 5 12

YES
NO
YES
YES
YES
NO
YES
YES
YES
NO

Constraints and Hints

For 20% of the data, N5,L100N\le 5, L\le 100;
For 40% of the data, N7N\le 7;
For 50% of the data, L5000L\le 5000;
For all data, N14,L109N\le 14, L\le 10^9.