*"Bapuji - Ae Jethiya Nahaane Jaa Nahaane Jaa".  
Bapuji is furious with Jethiya because he did not bathe before eating. Jethiya does not want to bathe right now, but in order to do so, he must first establish his innocence to Bapuji.*

Bapuji gives Jethiya a problem, and if Jethiya solves it, Bapuji will allow him to eat his food before taking a bath. Jethiya asks for your help to solve the problem.

You are given an array A of size N and an integer K. You can perform the following operation on the given array any number of times (possibly zero):
Choose two integers L and R (1 ≤ L ≤ R ≤ N)
Then, for each i such that L ≤ i ≤ R, set A_{i} to A_{\lfloor \frac{L+R}{2} \rfloor}. Here, \lfloor \ \rfloor denotes the [floor function].
That is, apply the following to the subarray [L, R]:
- If this subarray has odd length, set all its elements to be equal to the middle element.
- If it has even length, set all its elements to be equal to the left one among the two middle elements.

For example, if A = [1, 3, 2, 3] then:
If we choose L = 1 and R = 4, the array will change as follows: [\underline{1, \textcolor{blue}{3}, 2, 3}] \to [3, 3, 3, 3] 
If we choose L = 2 and R = 4, the array will change as follows: [1, \underline{3, \textcolor{blue}{2}, 3}] \to [1, 2, 2, 2] 

Is it possible to make all the array elements equal to K after performing some number of operations?

------ Input Format ------ 

- The first line of input will contain a single integer T, denoting the number of test cases.
- Each test case consists of two lines of input.
- The first line of each test case contains two space-separated integers N and K — the number of elements in the array and the value K respectively.
- The second line of each test case contains N space-separated integers A_{1}, A_{2}, \ldots, A_{N} — the elements of the array.

------ Output Format ------ 

For each test case, output on a new line the answer: Yes if all the elements can be made equal to K, and No otherwise.

Each letter of the output may be printed in either uppercase or lowercase, i.e, Yes, YES, and yEs will all be treated as equivalent.

------ Constraints ------ 

$1 ≤ T ≤ 10^{5}$
$1 ≤ N ≤ 10^{5}$
$-10^{9} ≤ K ≤ 10^{9}$
$-10^{9} ≤ A_{i} ≤ 10^{9}$
- The sum of $N$ across all test cases won't exceed $5\cdot 10^{5}$.

----- Sample Input 1 ------ 
4
4 10
1 2 3 4
3 1
1 2 3
5 5
7 -5 5 -2 5
4 9
-9 -9 8 0
----- Sample Output 1 ------ 
No
Yes
Yes
No

----- explanation 1 ------ 
Test case $1$: There is no way to make all the elements of the array equal $10$.

Test case $2$: One way of performing operations is as follows:
- First, choose $L = 1$ and $R = 2$. This makes the array $[1, 1, 3]$.
- Then, choose $L = 1$ and $R = 3$. This makes the array $[1, 1, 1]$, and we are done.

Test case $3$: Choose $L = 1$ and $R = 5$. The middle element is $5$ so everything becomes $5$, as required.

Test case $4$: There is no way to make everything equal to $9$.

Source: codechef | Difficulty: EASY
Tags: Ad-hoc


Solutions:
for _ in range(int(input())):
	(n, k) = map(int, input().strip().split())
	arr = list(map(int, input().strip().split()))
	count = arr.count(k)
	if count == 0:
		print('No')
	elif count == 1 and arr[-1] == k and (n != 1):
		print('No')
	else:
		print('Yes')


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = [int(x) for x in input().split()]
	if n == 1:
		print('Yes' if k in a else 'No')
	else:
		print('Yes' if k in a[:-1] else 'No')


for i in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	flag = False
	for i in range(n):
		if l[i] == k and i < n - 1:
			flag = True
	if n == 1 and l[0] == k:
		flag = True
	if flag:
		print('Yes')
	else:
		print('No')


t = int(input())
for ni in range(t):
	(n, k) = map(int, input().split())
	a = [int(i) for i in input().split()]
	if k > max(a) or k < min(a):
		print('No')
		continue
	if n == 1 and k == a[0]:
		print('Yes')
	elif k in a[:n - 1]:
		print('Yes')
	else:
		print('No')


for _ in range(int(input())):
	(N, K) = map(int, input().split())
	A = list(map(int, input().split()))
	if K in A[:-1]:
		print('Yes')
	elif N == 1 and K == A[0]:
		print('Yes')
	else:
		print('No')


for i in range(0, int(input())):
	(N, K) = map(int, input().split())
	A = list(map(int, input().split()))
	if K not in A:
		print('No')
	elif N == 1 and A[0] == K:
		print('Yes')
	elif A.count(K) == 1 and A[N - 1] == K:
		print('No')
	else:
		print('Yes')


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	n = [int(a) for a in input().split()]
	if b in n:
		if a == 1 or b in n[:a - 1]:
			print('Yes')
		else:
			print('No')
	else:
		print('No')


for i in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	if k not in a:
		print('No')
	else:
		ls = a[:n - 1]
		if k in ls or n == 1:
			print('Yes')
		else:
			print('No')


for _ in range(int(input())):
	(N, K) = map(int, input().split())
	s = list(map(int, input().split()))
	if K in s[:-1] or (N == 1 and s[0] == K):
		print('Yes')
	else:
		print('No')


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	if k in arr[:-1] or (n == 1 and arr[0] == k):
		print('Yes')
	else:
		print('No')


for test_case in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	if n != 1:
		l.pop()
	if k in l:
		print('Yes')
	else:
		print('No')


from math import sqrt, floor, ceil, gcd, factorial
from collections import defaultdict
from collections import OrderedDict
from collections import Counter
from collections import ChainMap

def getlist():
	return list(map(int, input().split()))

def getinp():
	return map(int, input().split())

def main():
	for _ in range(int(input())):
		(n, k) = getinp()
		arr = getlist()
		freq = Counter(arr)
		if k in freq:
			if n == 1:
				print('Yes')
			elif freq[k] == 1 and arr[n - 1] == k:
				print('No')
			else:
				print('Yes')
		else:
			print('No')
main()


test = int(input())
for i in range(test):
	(n, m) = map(int, input().split())
	arr = list(map(int, input().split()))
	if m == arr[0] and n == 1 or m in arr[:-1]:
		print('Yes')
	else:
		print('No')


for i in range(int(input())):
	(n, k) = map(int, input().split())
	A = list(map(int, input().strip().split()))
	if k in A:
		if A[n - 1] == k and n != 1 and (A.count(k) == 1):
			print('No')
		else:
			print('Yes')
	else:
		print('No')


t = int(input())
for case in range(0, t):
	(n, k) = [int(x) for x in input().split()]
	l = [int(x) for x in input().split()]
	if l.count(k) != 0:
		if l[n - 1] == k and n != 1 and (l.count(k) == 1):
			print('No')
		else:
			print('Yes')
	else:
		print('No')


T = int(input())
for i in range(T):
	(N, K) = map(int, input().split())
	lst = list(map(int, input().split()))
	if N == 1 and lst[0] == K:
		print('Yes')
	else:
		for j in range(N - 1):
			if lst[j] == K:
				print('Yes')
				break
		else:
			print('No')


n_test = int(input())
res = False
for i in range(n_test):
	data = input().split(' ')
	n = int(data[0])
	k = int(data[1])
	arr = []
	while len(arr) != n:
		arr = input().split(' ')
	for j in range(n):
		arr[j] = int(arr[j])
	if n > 0:
		if k in arr[:n - 1] or (n == 1 and k == arr[0]):
			print('Yes')
		else:
			print('No')
	else:
		print('No')


t = int(input())
for t in range(t):
	(n, m) = map(int, input().split())
	l = list(map(int, input().split()))
	if n > 1 and l[:n - 1].count(m) == 0 or l.count(m) == 0:
		print('No')
	else:
		print('Yes')


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	if a.count(k) == 0:
		eqk = False
	elif a.count(k) == 1 and a[-1] == k and (n > 1):
		eqk = False
	else:
		eqk = True
	if eqk == True:
		print('Yes')
	else:
		print('No')


m = int(input())
for i in range(m):
	(n, k) = [int(x) for x in input().split()]
	arr = list(map(int, input().split()))
	if n == 1 and k in arr:
		print('Yes')
	elif k in arr[0:n - 1]:
		print('Yes')
	else:
		print('No')


T = int(input())
for i in range(T):
	(N, K) = [int(x) for x in input().split()]
	ARR = list(map(int, input().split()))
	if N == 1 and K in ARR:
		print('Yes')
	elif K in ARR[0:N - 1]:
		print('Yes')
	else:
		print('No')


n = int(input())
for i in range(n):
	(N, K) = map(int, input().split())
	a = list(map(int, input().split()))
	b = a[0:-1]
	if N == 1:
		if a[0] == K:
			print('Yes')
		else:
			print('No')
		continue
	if b.count(K) >= 1:
		print('Yes')
	else:
		print('No')


testcase = int(input())
for i in range(testcase):
	(n, k) = map(int, input().split())
	lst = list(map(int, input().split()))
	if n == 1:
		if lst[0] == k:
			print('Yes')
		else:
			print('No')
		continue
	if k not in lst[0:-1]:
		print('No')
	else:
		print('Yes')


t = int(input())
while t != 0:
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	if k in arr and n == 1:
		print('Yes')
	elif k in arr[0:n - 1]:
		print('Yes')
	else:
		print('No')
	t -= 1


for i in range(int(input())):
	(N, K) = map(int, input().split())
	Array = list(map(int, input().split()))
	if N == 1 and K in Array:
		print('Yes')
		continue
	if K in Array[0:N - 1]:
		print('Yes')
	else:
		print('No')


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	return input().strip()

def invr():
	return map(int, input().split())

def outp(n):
	sys.stdout.write(str(n) + '\n')

def outlt(lst):
	sys.stdout.write(' '.join(map(str, lst)) + '\n')

def outplt(lst):
	sys.stdout.write('\n'.join(map(str, lst)))

def outpltlt(lst):
	sys.stdout.write('\n'.join(map(str, (' '.join(map(str, a)) for a in lst))))
ans = []
for _ in range(inp()):
	(N, K) = insr().split()
	A = insr()
	if N == '1':
		an = 'Yes' if A == K else 'No'
	else:
		an = 'Yes' if ' ' + K + ' ' in ' ' + A[:len(A) - A[::-1].index(' ')] else 'No'
	ans.append(an)
outplt(ans)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	li = list(map(int, input().split()))
	if n == 1:
		if k == li[0]:
			print('Yes')
			continue
	if k in li[0:n - 1]:
		print('Yes')
	else:
		print('No')


T = int(input())
for i in range(T):
	(n, b) = map(int, input().split())
	a = list(map(int, input().split()))
	if n == 1:
		if a[0] == b:
			print('Yes')
			continue
	if b in a[:-1]:
		print('Yes')
	else:
		print('No')


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	l = list(map(int, input().split()))
	if a == 1:
		if l[0] == b:
			print('Yes')
			continue
	if b in l[:-1]:
		print('Yes')
	else:
		print('No')


t = int(input())
while t > 0:
	(a, b) = input().split(' ')
	a = int(a)
	b = int(b)
	arr = list(map(int, input().split()))
	accu = arr.count(b)
	if a == 1 and arr[0] == b:
		print('Yes')
	elif arr[a - 1] == b and accu == 1:
		print('No')
	elif accu == 0:
		print('No')
	else:
		print('Yes')
	t -= 1


for i in range(int(input())):
	(N, K) = map(int, input().split())
	A = list(map(int, input().split()))
	if K in A:
		if A.index(K) != N - 1 or N == 1:
			print('Yes')
		else:
			print('No')
	else:
		print('No')


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	f = 0
	for i in a:
		if i == k:
			f = 1
			break
	if f == 0:
		print('No')
	elif a[-1] == k and a.count(k) == 1 and (n != 1):
		print('No')
	else:
		print('Yes')


t = int(input())
for i in range(t):
	(m, n) = map(int, input().split())
	l = list(map(int, input().split()))
	if n not in l:
		print('No')
		continue
	k = l.index(n)
	if m == 1:
		print('Yes')
	elif k == m - 1:
		print('No')
	else:
		print('Yes')


n = int(input())
for i in range(n):
	(a, b) = map(int, input().split())
	l = list(map(int, input().split()))
	if b not in l:
		print('No')
		continue
	k = l.index(b)
	if a == 1:
		print('Yes')
	elif k == a - 1:
		print('No')
	else:
		print('Yes')


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split(' '))
	l = list(map(int, input().split(' ')))
	a = -1
	for i in range(0, n):
		if l[i] == k:
			a = i
			break
	if a == -1 or (a == n - 1 and n != 1):
		print('No')
	else:
		print('Yes')


n = int(input())
for i in range(n):
	a = input().split(' ')[1]
	b = input().split(' ')
	if str(a) in b[:-1]:
		print('Yes')
	elif b == [str(a)]:
		print('Yes')
	else:
		print('No')


T = int(input())
for _ in range(T):
	(N, K) = map(int, input().split())
	A = list(map(int, input().split()))
	if K in A:
		if N > 1 and A.count(K) == 1:
			if A[N - 1] == K:
				print('No')
			else:
				print('Yes')
		else:
			print('Yes')
	else:
		print('No')


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	ls = list(map(int, input().split()))
	if n == 1 and k == ls[0]:
		print('Yes')
	elif k in ls[0:n - 1]:
		print('Yes')
	else:
		print('No')