#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int solve() {
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  bool isPresent = 0, yo = 0;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    if (a[i] == k) isPresent = 1;
    if (a[i] == k && i - 1 >= 0 && a[i - 1] == k) {
      yo = 1;
    }
  }
  if (isPresent == 0) {
    cout << "no" << endl;
    return 0;
  }
  if (n == 1 || yo == 1) {
    cout << "yes" << endl;
    return 0;
  }
  int i = 0;
  vector<pair<int, int>> pos;
  int last = 0;
  for (i = 0; i < n; ++i) {
    if (a[i] == k) {
      if (last <= i - 1) {
        pos.push_back({last, i - 1});
      }
      last = i + 1;
    }
  }
  if (a[n - 1] != k) {
    if (last <= n - 1) pos.push_back({last, n - 1});
  }
  bool isseg = 0;
  for (auto &p : pos) {
    isseg = 1;
    int f = p.first, s = p.second;
    int ans = 1, mx = 1;
    int last = f - 1, dist = INT_MAX;
    for (int j = f; j <= s; ++j) {
      if (a[j] > k) {
        if (f - 1 >= 0) {
          dist = min(dist, j - (f - 1));
        }
        if (s + 1 <= n - 1) {
          dist = min(dist, s + 1 - j);
        }
        if (last != -1) dist = min(dist, j - last);
        last = j;
      }
    }
    if (dist <= 2 || (s == f && s + 1 <= n - 1 && f - 1 >= 0)) {
      cout << "yes" << endl;
      return 0;
    }
  }
  if (!isseg)
    cout << "yes" << endl;
  else
    cout << "no" << endl;
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
