#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int i = 1; i <= t; i++) {
    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    int flag = 0;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] < k)
        a[i] = 0;
      else if (a[i] == k)
        a[i] = 1;
      else
        a[i] = 2;
      if (a[i] == 1) flag = 1;
    }
    if (!flag) {
      cout << "NO\n";
    } else if (n == 1) {
      cout << "YES\n";
    } else {
      flag = 0;
      for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n && j - i <= 2; j++) {
          if (a[i] > 0 && a[j] > 0) {
            flag = 1;
            break;
          }
          if (flag) break;
        }
      }
      if (flag)
        cout << "YES\n";
      else
        cout << "NO\n";
    }
  }
  return 0;
}
