#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e6 + 10;
long long n, t, k, A[maxn], B[maxn], C[maxn];
bool check() {
  for (long long i = 0; i < n; i++) {
    B[i + 1] = B[i];
    if ((A[i] >= k)) {
      B[i + 1]++;
    } else {
      B[i + 1]--;
    }
  }
  C[n] = B[n];
  for (long long i = n - 1; i >= 0; i--) {
    C[i] = max(B[i], C[i + 1]);
  }
  long long mn = 0;
  for (long long i = 0; i < n; i++) {
    if (A[i] >= k) {
      long long r = C[i + 2] - B[i];
      long long l = B[i + 1] - mn;
      if (((i > 0 && l > 0) || (i < n - 1 && r > 0))) {
        return true;
      }
    }
    mn = min(B[i], mn);
  }
  return false;
}
int32_t main() {
  cin >> t;
  while (t--) {
    cin >> n >> k;
    fill(C, C + n + 5, 0);
    B[0] = 0;
    bool h = 0;
    for (long long i = 0; i < n; i++) {
      cin >> A[i];
      h |= (A[i] == k);
    }
    bool flag = false;
    if (n == 1) {
      flag = (A[0] == k);
      cout << (flag ? "yes" : "no") << endl;
      continue;
    }
    flag = (h && check());
    cout << (flag ? "yes" : "no") << endl;
  }
}
