#GYM104743B. Array Construction
Array Construction
Description
You're given three non-negative integers $n,x$ and $y$.
Determine if you can construct an array $a$ of size $n$ satisfying:
- All elements in $a$ are distinct;
- $a_1 | ... | a_n = x$;
- $a_1 \& ... \& a_n = y$.
Here $|$ denotes the bitwise OR operation and $\&$ denotes the bitwise AND operation.
If you can construct such array $a$ output YES.Otherwise,output NO.
Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 10^5$). The description of the test cases follows.
The only line of each testcase contains three integers $n,x,y$ ($1 \le n \le 2^{30}-1,0 \le x,y \le 2^{30}-1$).
For each testcase output in a new line — If you can construct such array $a$ output YES.Otherwise,output NO.
Input
Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 10^5$). The description of the test cases follows.
The only line of each testcase contains three integers $n,x,y$ ($1 \le n \le 2^{30}-1,0 \le x,y \le 2^{30}-1$).
Output
For each testcase output in a new line — If you can construct such array $a$ output YES.Otherwise,output NO.
4
1 0 0
3 14 2
1000000000 14 2
3 6 5
YES
YES
NO
NO