You are given an array A of n integers and an integer k. You need to find if there is any non-empty subset in the array such that the bitwise AND of all integers in the subset is less than k or not.
The first line contains an integer t(1 ≤ t ≤ 50), the number of test cases.
For each test case, the first line contains two integers n(1 ≤ n ≤ 105) , k(0 ≤ k ≤ 109) and the next line contains n integers Ai(0 ≤ Ai ≤ 109) where Ai is the ith element of the array.
It is guaranteed that the sum of lengths of all given arrays doesn't exceed 5*105.
Output "YES"(without quotes) if there is any subset in the array such that the bitwise AND of all integers in the subset is less than k and output "NO"(without quotes) otherwise.
Input | Output |
---|---|
2 2 3 1 1 1 2 4 | YES NO |