#include <bits/stdc++.h>
using namespace std;
const int Sz = 1e5 + 5;
int a[Sz];
bool check(int p, int v, int n) { return (p > 0 && p <= n && a[p] >= v); }
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int Test = 1;
  cin >> Test;
  while (Test--) {
    int n, k;
    cin >> n >> k;
    vector<int> p;
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
      if (a[i] == k) p.push_back(i);
    }
    bool res = (!p.empty() && n == 1);
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= 2; j++)
        for (int sig = -1; sig <= 1; sig += 2)
          if (check(i, k, n) && check(i + j * sig, k, n)) res = true;
    if (res && !p.empty())
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
