#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using cd = complex<double>;
bool has_sol(vector<int> v) {
  if (all_of(begin(v), end(v), [&](int x) { return x != 1; })) return false;
  for (int i = 0, j = 1, k = 2; k < v.size(); ++i, ++j, ++k)
    if (v[j] == 0 && v[i] > 0 && v[k] > 0) return true;
  for (int i = 0, j = 1; j < v.size(); ++i, ++j)
    if (v[i] > 0 && v[j] > 0) return true;
  if (all_of(begin(v), end(v), [&](int x) { return x > 0; })) return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int t;
  cin >> t;
  while (t--) {
    int n, k;
    cin >> n >> k;
    vector<int> v(n);
    for (auto& x : v) {
      cin >> x;
      if (x > k)
        x = 2;
      else if (x < k)
        x = 0;
      else
        x = 1;
    }
    cout << (has_sol(v) ? "yes" : "no") << '\n';
  }
  return 0;
}
