BaoBao has just found a positive integer sequence a 1 , a 2 , … … , a n a_{1},a_{2},……,a_{n} a1,a2,……,an of length n from his left pocket and another positive integer b from his right pocket. As number 7 is BaoBao’s favorite number, he considers a positive integer lucky if is divisible by 7. He now wants to select an integer a k a_{k} ak from the sequence such that ( a k + b a_{k} + b ak+b ) is lucky. Please tell him if it is possible.
There are multiple test cases. The first line of the input is an integer T (about 100), indicating the number of test cases. For each test case:
The first line contains two integers n and b ( 1 ≤ n , b ≤ 100 1 \le n,b \le 100 1≤n,b≤100 ), indicating the length of the sequence and the positive integer in BaoBao’s right pocket.
The second line contains n positive integers a 1 , a 2 , … … , a n a_{1},a_{2},……,a_{n} a1,a2,……,an ( 1 ≤ n ≤ 100 1 \le n \le 100 1≤n≤100 ), indicating the sequence.
For each test case output one line. If there exists an integer a k a_{k} ak such that a k ∈ { a 1 , a 2 , … … , a n } a_{k} \in \{a_{1},a_{2},……,a_{n}\} ak∈{a1,a2,……,an} and ( a k + b ) (a_{k} + b) (ak+b) is lucky, output “Yes” (without quotes), otherwise output “No” (without quotes).
4 3 7 4 5 6 3 7 4 7 6 5 2 2 5 2 5 2 4 26 100 1 2 4
No Yes Yes Yes
直接枚举判断是否存在 ( a i + b ) % 7 = = 0 (a_{i}+b) \% 7 == 0 (ai+b)%7==0 。
