#P10835. 『FLA - I』冲云霄

    ID: 10340 远端评测题 1000ms 512MiB 尝试: 0 已通过: 0 难度: 3 上传者: 标签>数学洛谷原创O2优化位运算洛谷月赛

『FLA - I』冲云霄

Description

Given integers nn and mm, determine whether there is a sequence aa that satisfying the following constraints. The indices of the sequence elements in this question start from 11.

  • The length of the sequence aa is mm, and each entry of the sequence aa is a positive integer.

  • a1a2am=na_1 \oplus a_2 \oplus \cdots \oplus a_m = n, that is, the result of XORing all entries of the sequence aa is equal to nn.

  • All the entries in aa are the same.

Input Format

Each test consists of multiple test cases.

The first line contains an integer TT — the number of test cases. Then follows the description of the test cases.

Each test case consists of one line. The only line of each test case contains two integers nn and mm.

Output Format

For each test case, if there is a sequence aa that satisfies the restrictions, print Yes; otherwise, print No.

4
3 3
2 5
0 3
1 4

Yes
Yes
No
No

Hint

「Sample Explanation #1」

For the first test case, the sequence aa can be [3,3,3][3,3,3], in which case $a_1 \oplus a_2 \oplus a_3 = 3 \oplus 3 \oplus 3 = 3$.

For the second test case, the sequence aa can be [2,2,2,2,2][2,2,2,2,2], in which case $a_1 \oplus a_2 \oplus a_3 \oplus a_4 \oplus a_5 = 2 \oplus 2 \oplus 2 \oplus 2 \oplus 2 = 2$.

For the third and fourth test cases, it can be proved that there is no sequence that satisfies the restrictions.

「Constraints」

Test Id TT \leq nn \leq mm \leq
121 \sim 2 55 00 10910^9
343 \sim 4 10910^9 33
55 10510^5 10910^9

Each test is worth 2020 points.

For all tests, 1T1051 \leq T \leq 10^5, 0n1090 \leq n \leq 10^9, 2m1092 \leq m \leq 10^9.