#include <bits/stdc++.h>
using namespace std;
const int mxN = 1e5 + 5;
const long long INF = 1e18;
const long long mod = 1e9 + 7;
signed main() {
  int t;
  cin >> t;
  while (t--) {
    int n, k;
    cin >> n >> k;
    vector<int> v(n);
    int cnt = 0;
    for (int i = 0; i < n; i++) {
      cin >> v[i];
      if (v[i] == k) cnt++;
    }
    if (cnt == 0) {
      cout << "NO" << endl;
      continue;
    }
    if (cnt == n) {
      cout << "YES" << endl;
      continue;
    }
    bool check = false;
    for (int i = 0; i < n - 1; i++) {
      if (v[i] >= k && v[i + 1] >= k) {
        check = true;
        break;
      }
    }
    for (int i = 0; i < n - 2; i++) {
      if (v[i] >= k && v[i + 2] >= k) {
        check = true;
        break;
      }
    }
    if (check)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
