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