#include <bits/stdc++.h>
using namespace std;
int T, N, K, b[200005], a[200005];
int pref[200005], suf[200005], mn[200005];
void solve() {
  cin >> N >> K;
  bool isK = 0;
  for (int i = 1; i <= N; i++) {
    cin >> a[i];
    if (a[i] == K) isK = 1;
    b[i] = (a[i] >= K ? 1 : -1);
  }
  if (N == 1) {
    cout << (a[1] == K ? "yes\n" : "no\n");
    return;
  }
  if (!isK) {
    cout << "no\n";
    return;
  }
  for (int i = 1; i <= N; i++) {
    pref[i] = pref[i - 1] + b[i];
    mn[i] = min(mn[i - 1], pref[i]);
    if (i > 1 && mn[i - 2] < pref[i]) {
      cout << "yes\n";
      return;
    }
  }
  mn[N + 1] = 0;
  suf[N + 1] = 0;
  for (int i = N; i >= 1; i--) {
    suf[i] = suf[i + 1] + b[i];
    mn[i] = min(mn[i + 1], suf[i]);
    if (i < N && mn[i + 2] < suf[i]) {
      cout << "yes\n";
      return;
    }
  }
  cout << "no\n";
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cin >> T;
  while (T--) solve();
  return 0;
}
