#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
using vd = vector<double>;
const ll delta = 0.0000001;
const ll INF = 1e18 + 7;
const ll MOD = 1e9 + 7;
ll t;
ll n, k;
vl a;
ll rt;
int main() {
  cin.tie(0);
  cout.tie(0);
  cin.sync_with_stdio(false);
  cout.sync_with_stdio(false);
  cin >> t;
  for (ll(rock) = 0; (rock) < (t); ++(rock)) {
    cin >> n >> k;
    ll cur;
    bool ok1 = false;
    bool ok2 = false;
    a.resize(n);
    if (n > 2) {
      ll cur_cnt = 0;
      for (ll(i) = 0; (i) < (n); ++(i)) {
        cin >> rt;
        if (rt < k) {
          a[i] = -1;
        } else if (rt == k) {
          a[i] = 0;
        } else {
          a[i] = 1;
        }
      }
      for (ll(i) = 0; (i) < (3); ++(i)) {
        if (a[i] == -1) {
          ++cur_cnt;
        }
        if (a[i] == 0) {
          ok1 = true;
        }
      }
      if (cur_cnt < 2) {
        ok2 = true;
      }
      for (int i = 3; i < n; ++i) {
        if (a[i] == -1) {
          ++cur_cnt;
        }
        if (a[i - 3] == -1) {
          --cur_cnt;
        }
        if (cur_cnt < 2) {
          ok2 = true;
        }
        if (a[i] == 0) {
          ok1 = true;
        }
      }
      if (ok1 && ok2) {
        cout << "yes" << endl;
      } else {
        cout << "no" << endl;
      }
    } else if (n == 2) {
      cin >> a[0] >> a[1];
      sort((a).begin(), a.end());
      if (a[0] == k) {
        cout << "yes" << endl;
      } else {
        cout << "no" << endl;
      }
    } else {
      cin >> a[0];
      if (a[0] == k) {
        cout << "yes" << endl;
      } else {
        cout << "no" << endl;
      }
    }
  }
  return 0;
}
