For a multiset $$$\mathcal{S}$$$ and a positive integer $$$k$$$, let $$$\operatorname{mex}_k(\mathcal{S})$$$ be the smallest non-negative integer that appears in $$$\mathcal{S}$$$ fewer than $$$k$$$ times. In particular, $$$\operatorname{mex}_1(\mathcal{S})$$$ is the usual $$$\operatorname{mex}$$$$$$^{\text{∗}}$$$ of $$$\mathcal{S}$$$.
For example:
You are given an even integer $$$n$$$, a positive integer $$$k$$$, and $$$n$$$ cards. The integer $$$a_i$$$ is written on the $$$i$$$-th card.
Alice and Bob play the following game with these cards. Alice moves first, and the players alternate turns. On each turn, the current player takes any one of the remaining cards. The game ends when all $$$n$$$ cards have been taken, so each player ends up with exactly $$$\dfrac{n}{2}$$$ cards.
Let $$$\mathcal{A}$$$ be the multiset of integers written on Alice's cards, and let $$$\mathcal{B}$$$ be the multiset of integers written on Bob's cards. Alice wins if $$$\operatorname{mex}_k(\mathcal{A}) \ne \operatorname{mex}_k(\mathcal{B})$$$, and Bob wins otherwise.
Determine whether Alice wins if both players play optimally.
$$$^{\text{∗}}$$$The minimum excluded (MEX) of a collection of integers $$$c_1, c_2, \ldots, c_m$$$ is defined as the smallest non-negative integer $$$x$$$ which does not occur in the collection $$$c$$$.
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 10^4$$$). The description of the test cases follows.
The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$2 \le n \le 2 \cdot 10^5$$$, $$$n$$$ is even, $$$1 \le k \le n$$$) — the number of cards and the parameter of the game.
The second line of each test case contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i \le n$$$) — the integers written on the cards.
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2 \cdot 10^5$$$.
For each test case, output "YES" if Alice wins, and "NO" otherwise.
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.
54 12 0 0 14 10 1 0 16 21 2 0 1 0 06 20 0 1 1 2 28 20 1 1 0 0 2 0 1
YESNOYESNOYES
In the first example, Alice can take the card showing $$$1$$$ on her first turn and a card showing $$$0$$$ on her second turn. Then $$$\mathcal{A} = \{0, 1\}$$$ and $$$\mathcal{B} = \{0, 2\}$$$, so $$$\operatorname{mex}_1(\mathcal{A}) = 2$$$ and $$$\operatorname{mex}_1(\mathcal{B}) = 1$$$. It can be proven that Alice wins regardless of Bob's moves, so the answer is "YES".
In the second example, the players can take cards in the following order: Alice takes $$$1$$$, Bob takes $$$1$$$, Alice takes $$$0$$$, and Bob takes $$$0$$$. Then $$$\mathcal{A} = \mathcal{B} = \{0, 1\}$$$ and $$$\operatorname{mex}_1(\mathcal{A}) = \operatorname{mex}_1(\mathcal{B}) = 2$$$. It can be proven that Bob wins if both players play optimally, so the answer is "NO".