Two Frogs
Contest: Codeforces Round 996 (Div. 2)
Difficulty rating: 800
Tags: constructive algorithms, games, greedy, math

Roaming through the alligator-infested Everglades, Florida Man encounters a most peculiar showdown.

There are $$$n$$$ lilypads arranged in a row, numbered from $$$1$$$ to $$$n$$$ from left to right. Alice and Bob are frogs initially positioned on distinct lilypads, $$$a$$$ and $$$b$$$, respectively. They take turns jumping, starting with Alice.

During a frog's turn, it can jump either one space to the left or one space to the right, as long as the destination lilypad exists. For example, on Alice's first turn, she can jump to either lilypad $$$a-1$$$ or $$$a+1$$$, provided these lilypads are within bounds. It is important to note that each frog must jump during its turn and cannot remain on the same lilypad.

However, there are some restrictions:

- The two frogs cannot occupy the same lilypad. This means that Alice cannot jump to a lilypad that Bob is currently occupying, and vice versa.
- If a frog cannot make a valid jump on its turn, it loses the game. As a result, the other frog wins.

Determine whether Alice can guarantee a win, assuming that both players play optimally. It can be proven that the game will end after a finite number of moves if both players play optimally.

Input format:
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). The description of the test cases follows.

The first and only line of each test case contains three integers $$$n$$$, $$$a$$$, and $$$b$$$ ($$$2 \leq n \leq 100$$$, $$$1 \leq a, b \leq n$$$, $$$a\neq b$$$) — the number of lilypads, and the starting positions of Alice and Bob, respectively.

Note that there are no constraints on the sum of $$$n$$$ over all test cases.

Output format:
For each test case, print a single line containing either "YES" or "NO", representing whether or not Alice has a winning strategy.

You can output the answer in any case (upper or lower). For example, the strings "yEs", "yes", "Yes", and "YES" will be recognized as positive responses.

Constraints:
Time limit: 1.0 s
Memory limit: 256.0 MB

Note:
In the first test case, Alice has no legal moves. Therefore, Alice loses on the first turn.

In the second test case, Alice can only move to lilypad $$$2$$$. Then, Bob has no legal moves. Therefore, Alice has a winning strategy in this case.

In the third test case, Alice can only move to lilypad $$$1$$$. Then, Bob can move to lilypad $$$2$$$. Alice is no longer able to move and loses, giving Bob the win. It can be shown that Bob can always win regardless of Alice's moves; hence, Alice does not have a winning strategy.

Example input:
5
2 1 2
3 3 1
4 2 3
5 2 4
7 6 2

Example output:
NO
YES
NO
YES
YES

Editorial:
Notice that regardless of how the players move, the difference between the numbers of the lilypads the two players are standing on always alternates even and odd, depending on the starting configuration. Then, the key observation is that exactly one player has the following winning strategy:
• Walk towards the other player, and do not stop until they are forced onto lilypad $$$1$$$ or $$$n$$$.
In the case that they start on lilypads with different parity, analogous logic shows that Bob wins. Therefore, for each case, we only need to check the parity of the lilypads for a constant time solution.