#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimization("unroll-loops")
const int N = 2e5 + 5;
const long long int mod = 1e9 + 7;
const long long int Mod = 998244353;
const long double Pi = acos(-1);
const long long int Inf = 4e18;
using namespace std;
void TestCase() {
  int n, k, pos = n + 1;
  cin >> n >> k;
  bool ok = false;
  vector<int> a(n + 1), pref(n + 1, 0);
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] == k) {
      ok = true;
      pos = min(pos, i);
    }
  }
  if (ok) {
    ok = false;
    for (int i = 1; i <= n; i++) {
      a[i] = (a[i] >= k ? 1 : -1);
    }
    int sum = 0, mi = 0;
    for (int i = 1; i <= n; i++) {
      sum += a[i];
      pref[i] = min(pref[i - 1], sum);
      if (i >= 2) {
        if (sum - pref[i - 2] > 0) ok = true;
      }
    }
  }
  if (n == 1 && pos == 1) ok = true;
  ok ? cout << "yes" : cout << "no";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  int T = 1;
  cin >> T;
  while (T--) {
    TestCase();
    cout << "\n";
  }
  return 0;
}
