#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << setprecision(12) << fixed;
}
void solve() {
  long long n, k, f = 0;
  cin >> n >> k;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] > k)
      a[i] = 2;
    else if (a[i] < k)
      a[i] = 0;
    else
      a[i] = 1, f = 1;
  }
  if (!f) {
    cout << "NO"
         << "\n";
    return;
  }
  if (n == 1) {
    cout << "YES"
         << "\n";
    return;
  }
  f = 0;
  for (long long i = 0; i < n; i++) {
    for (long long j = i + 1; j < n && j - i <= 2; j++) {
      if (a[i] && a[j]) f = 1;
    }
  }
  cout << (f ? "YES\n" : "NO\n");
}
int main() {
  fast();
  long long t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
}
