#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int t;
  cin >> t;
  while (t--) {
    int n, k;
    cin >> n >> k;
    vector<int> a(n + 2, 0);
    bool exist = false;
    for (int i = 1; i <= n; ++i) {
      cin >> a[i];
      if (a[i] == k) exist = true;
    }
    if (!exist) {
      cout << "NO\n";
      continue;
    }
    if (n == 1) {
      cout << "YES\n";
      continue;
    }
    exist = false;
    for (int i = 1; i <= n; ++i) {
      if (a[i] >= k) {
        int j = i + 1;
        while (j <= n && a[j] < k) ++j;
        if (j <= n && j - i <= 2) exist = true;
      }
    }
    cout << (exist ? "YES\n" : "NO\n");
  }
}
