The stones game has simple rules and it is very old.
The game starts with N stones and M players. The players are numbered from 1 to M. Player 1 takes the first turn, then player 2, and so on up to player M. After player M finishes a turn, player 1 goes again, and the game repeats this order until it ends.
Each turn consists of the following two steps.
So a player removes 0, 1 or 2 stones during a single turn, depending on the rules above. The player who removes the last stone wins the game.
You are given the number of stones, the number of players, and one player number. Decide whether that player has a strategy that always wins, whatever the other players do on their turns.
Your program is tested on one or more test cases. The first line of the input has a single integer T, the number of test cases (1≤T≤100). Each of the next T lines describes one test case and holds three integers separated by a single space, N, M, X (1≤N,M≤109, 1≤X≤M), the number of stones, the number of players, and the player number.
For each test case, print a single word on its own line. Print YES if player X has a strategy that always wins regardless of what the other players do, and NO otherwise.