#include <bits/stdc++.h>
const int N = 1e5 + 5;
using namespace std;
int T, n, k;
int a[N];
void solve() {
  cin >> n >> k;
  int mi = 1e9, cc = 0, dd = 0;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    a[i] = a[i - 1];
    if (x == k) dd = 1;
    if (cc) continue;
    if (n == 1 && x == k) cc = 1;
    if (x >= k)
      a[i]++;
    else
      a[i]--;
    if (i >= 2) mi = min(mi, a[i - 2]);
    if (a[i] > mi) cc = 1;
  }
  if (!cc || !dd)
    cout << "no\n";
  else
    cout << "yes\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> T;
  while (T--) {
    solve();
  }
}
