#include <bits/stdc++.h>
char *fs, *ft, buf[1 << 20];
inline long long read() {
  long long x = 0, f = 1;
  char ch =
      (fs == ft && (ft = (fs = buf) + fread(buf, 1, 1 << 20, stdin), fs == ft))
          ? 0
          : *fs++;
  ;
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = (fs == ft &&
          (ft = (fs = buf) + fread(buf, 1, 1 << 20, stdin), fs == ft))
             ? 0
             : *fs++;
    ;
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = (fs == ft &&
          (ft = (fs = buf) + fread(buf, 1, 1 << 20, stdin), fs == ft))
             ? 0
             : *fs++;
    ;
  }
  return x * f;
}
using namespace std;
const long long N = 1e5 + 5;
const long long inf = 0x7fffffff;
const long long mod = 998244353;
const double eps = 1e-6;
long long a[N];
signed main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n, k;
    cin >> n >> k;
    bool ok = 0;
    for (long long i = 1; i <= n; i++) {
      cin >> a[i];
      if (a[i] == k) ok = 1;
      a[i] = (a[i] >= k);
    }
    if (!ok) {
      cout << "NO" << '\n';
      continue;
    }
    for (long long i = 1; i <= n - 1; i++) {
      if (i + 2 <= n)
        if (a[i] + a[i + 1] + a[i + 2] >= 2) ok = 0;
      if (a[i] + a[i + 1] >= 2) ok = 0;
    }
    if (ok == 0 || n == 1)
      cout << "yes" << '\n';
    else
      cout << "NO" << '\n';
  }
}
