The Stones Game

No attempts yetTime limit1sMemory limit128 MB

Problem

The stones game has simple rules and it is very old.

The game starts with NN stones and MM players. The players are numbered from 11 to MM. Player 11 takes the first turn, then player 22, and so on up to player MM. After player MM finishes a turn, player 11 goes again, and the game repeats this order until it ends.

Each turn consists of the following two steps.

  1. The player whose turn it is gets a chance to remove one stone. If the player decides to remove a stone, exactly one stone leaves the pile in this step.
  2. This step happens regardless of the decision made in step 1. If this is not the first turn and the player of the previous turn decided not to remove a stone in step 1, then the current player must remove one stone in this step. If the player of the previous turn did remove a stone in step 1, then the current player must not remove a stone in this step.

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.

Input

Your program is tested on one or more test cases. The first line of the input has a single integer TT, the number of test cases (1T1001 \le T \le 100). Each of the next TT lines describes one test case and holds three integers separated by a single space, NN, MM, XX (1N,M1091 \le N, M \le 10^9, 1XM1 \le X \le M), the number of stones, the number of players, and the player number.

Output

For each test case, print a single word on its own line. Print YES if player XX has a strategy that always wins regardless of what the other players do, and NO otherwise.