#include <bits/stdc++.h>
using namespace std;
long long m, k, n, arr[200002], t;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> t;
  for (int l = 0; l < t; l++) {
    cin >> n >> k;
    for (int i = 0; i < n; i++) cin >> arr[i];
    int f = 0;
    for (int i = 0; i < n; i++)
      if (arr[i] == k) f = 1;
    if (!f) {
      cout << "NO" << '\n';
      continue;
    }
    if (n == 1) {
      cout << "YES" << '\n';
      continue;
    }
    for (int i = 0; i < n; i++) {
      if (arr[i] == k)
        arr[i] = 1;
      else if (arr[i] < k)
        arr[i] = 0;
      else
        arr[i] = 2;
    }
    int lst = -5;
    f = 0;
    for (int i = 0; i < n; i++) {
      if (arr[i] != 0) {
        if (i - lst <= 2) {
          f = 1;
          break;
        }
        lst = i;
      }
    }
    if (!f) {
      cout << "NO" << '\n';
    } else
      cout << "YES" << '\n';
  }
}
