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.