#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define FAST ios::sync_with_stdio(0), cin.tie(0),cout.tie(0)
#define ll long long
#define ld long double
#define int long long
#define endl "\n"
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define pb push_back
//#pragma GCC optimize("O3,unroll-loops")
//#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
using namespace std;
const int MOD = 1e9+7  ;
//const int MOD = 998244353  ;
const int N = 1e5+5  ;
const ll INF = 1e18 ;
const ll MIN = -1e18 ;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;


void solve() {
    ll n,k;cin>>n>>k;
    vector<ll> a(n+2,0);
    vector<ll> pref1(n+2,0),pref2(n+2,0);
    for(int i=1;i<=n;i++){
        cin>>a[i];
        if(a[i]==k){
            pref1[i]++;
        }
        if(a[i]<k){
            pref2[i]++;
        }
        pref1[i]+=pref1[i-1];
        pref2[i]+=pref2[i-1];
    }
    if(n==1 && a[1]==k){
        yes;
        return;
    }
    ll test=0;
    for(int i=1;i<=n;i++){
        if(a[i]==k && (a[i-1]>=a[i] || a[i+1]>=a[i])){
            test=1;
        }
    }
    for(int i=3;i<=n;i++){
        if(a[i]==k && a[i-2]==k){
            test=1;
        }
    }
    if(test){
        yes;
        return;
    }
    no;

}

signed main() {
    FAST;
    auto begin = std::chrono::high_resolution_clock::now();
    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif
    ll t=1;
    cin>>t;
    while(t--) solve();
    #ifndef ONLINE_JUDGE
        auto end = std::chrono::high_resolution_clock::now();
        cout << setprecision(4) << fixed;
        cout << "Execution time: " << std::chrono::duration_cast<std::chrono::duration<double>>(end - begin).count() << " seconds" << endl;
    #endif
}


