Still Cutting Game
题号:NC209973
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Here's another cutting game, which is also joyful.

The game uses  rectangular paper and the -th paper among them consists of  grids. Two players should choose one paper and cut this paper into two new pieces of rectangular paper in turn. Note that the player can also choose this new paper for cut.

In each turn the player can cut either horizontally or vertically, keeping every grids unbroken. Therefore, you can't do anything on a  paper. What's more, players can't skip their turns.

The player who can't move lose this game and his opponent win this game.

Now, given the initial  paper, you're asked to determine who will win this game eventually if both players play optimally.

输入描述:

The first line of input consists of a interger , which means there are  test cases.

For each test case, the first line consists of a interger , the numbers of paper.

Then following  lines, each line consists of two interger, which means .

输出描述:

For each test, output "YES" if the first player will win the game or output "NO" instead.
示例1

输入

复制
2
1
1 1
1
2 2

输出

复制
NO
YES