#include <bits/stdc++.h>
using namespace std;
const long long Mod = 1e9 + 7;
const int N = 3e5 + 5;
int arr[N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n, k;
    bool ans = false, exist = false;
    cin >> n >> k;
    for (int i = 0; i < n; i++) {
      cin >> arr[i];
      exist |= (arr[i] == k);
    }
    for (int i = 0; i < n; i++) {
      if (i && arr[i] >= k && arr[i - 1] >= k) ans = true;
      if (i > 1 && arr[i] >= k && arr[i - 2] >= k) ans = true;
    }
    ans &= exist;
    if (ans || (n == 1 && arr[0] == k))
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
