Slime has a sequence of positive integers $a_1, a_2, \ldots, a_n$.

In one operation Orac can choose an arbitrary subsegment $[l \ldots r]$ of this sequence and replace all values $a_l, a_{l + 1}, \ldots, a_r$ to the value of median of $\{a_l, a_{l + 1}, \ldots, a_r\}$.

In this problem, for the integer multiset $s$, the median of $s$ is equal to the $\lfloor \frac{|s|+1}{2}\rfloor$-th smallest number in it. For example, the median of $\{1,4,4,6,5\}$ is $4$, and the median of $\{1,7,5,8\}$ is $5$.

Slime wants Orac to make $a_1 = a_2 = \ldots = a_n = k$ using these operations.

Orac thinks that it is impossible, and he does not want to waste his time, so he decided to ask you if it is possible to satisfy the Slime's requirement, he may ask you these questions several times.


-----Input-----

The first line of the input is a single integer $t$: the number of queries.

The first line of each query contains two integers $n\ (1\le n\le 100\,000)$ and $k\ (1\le k\le 10^9)$, the second line contains $n$ positive integers $a_1,a_2,\dots,a_n\ (1\le a_i\le 10^9)$

The total sum of $n$ is at most $100\,000$.


-----Output-----

The output should contain $t$ lines. The $i$-th line should be equal to 'yes' if it is possible to make all integers $k$ in some number of operations or 'no', otherwise. You can print each letter in lowercase or uppercase.


-----Example-----
Input
5
5 3
1 5 2 6 1
1 6
6
3 2
1 2 3
4 3
3 1 2 3
10 3
1 2 3 4 5 6 7 8 9 10

Output
no
yes
yes
no
yes



-----Note-----

In the first query, Orac can't turn all elements into $3$.

In the second query, $a_1=6$ is already satisfied.

In the third query, Orac can select the complete array and turn all elements into $2$.

In the fourth query, Orac can't turn all elements into $3$.

In the fifth query, Orac can select $[1,6]$ at first and then select $[2,10]$.

Difficulty: competition

Starter code:

Solutions:
import sys
input = lambda: sys.stdin.readline().rstrip()
T = int(input())
for _ in range(T):
    N, K = list(map(int, input().split()))
    A = [int(a) for a in input().split()]
    if K not in A:
        print("no")
        continue
    
    if N == 1 or (A[0] >= K and A[1] >= K):
        print("yes")
        continue
    
    for i in range(2, N):
        if A[i] >= K and (A[i-1] >= K or A[i-2] >= K):
            print("yes")
            break
    else:
        print("no")
        continue


import sys
readline = sys.stdin.readline

T = int(readline())
Ans = ['no']*T

for qu in range(T):
    N, K = list(map(int, readline().split()))
    A = list(map(int, readline().split()))
    A = [-1 if a < K else 0 if a == K else 1 for a in A]
    if 0 not in A:
        continue
    for i in range(1, N-1):
        if A[i] < 0 and A[i-1] >= 0 and A[i+1] >= 0:
            A[i] = 1
    for i in range(2, N):
        if A[i] < 0 and A[i-1] >= 0 and A[i-2] >= 0:
            A[i] = 1
    for i in range(N-3, -1, -1):
        if A[i] < 0 and A[i+1] >= 0 and A[i+2] >= 0:
            A[i] = 1
    for i in range(1, N):
        if A[i] == 1 and A[i-1] == 0:
            A[i] = 0
    for i in range(N-2, -1, -1):
        if A[i] == 1 and A[i+1] == 0:
            A[i] = 0
    A.sort()
    if A[-1-(-N//2)] == 0:
        Ans[qu] = 'yes'
print('\n'.join(Ans))


import sys
input = sys.stdin.readline

Q = int(input())
Query = []
for _ in range(Q):
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    Query.append((N, K, A))

for N, K, A in Query:
    Inds = []
    exists = False
    for i, a in enumerate(A):
        if a == K: exists = True
        if a >= K:
            Inds.append(i)
    
    if not exists:
        ok = False
    elif N == 1:
        ok = True
    else:
        ok = False
        for ind in Inds:
            if ind < N-1 and A[ind+1] >= A[ind]:
                ok = True
            elif ind > 0 and A[ind-1] >= A[ind]:
                ok = True
            elif ind > 1 and A[ind-2] >= A[ind]:
                ok = True
            elif ind < N-2 and A[ind+2] >= A[ind]:
                ok = True
    print("yes" if ok else "no")