#include <bits/stdc++.h>
using namespace std;
long long int pow1(long long int a, long long int b,
                   long long int m = 1000000007) {
  if (b == 0)
    return 1ll;
  else if (b == 1)
    return a;
  else {
    long long int x = pow1(a, b / 2, m);
    x *= x;
    x %= m;
    if (b % 2) {
      x *= a;
      x %= m;
    }
    return x;
  }
}
template <class avgType>
avgType avg(avgType a, avgType b) {
  return (a + b) / 2;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
mt19937_64 rng64(chrono::steady_clock::now().time_since_epoch().count());
int randInt() { return rng() % INT_MAX; }
long long int randLL() { return rng64() % LLONG_MAX; }
vector<int> hashmods = {1000000007, 1000000009, 1000000021,
                        1000000033, 1000000087, 1000000093};
long long int n, k, a[110000], t;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> t;
  while (t--) {
    cin >> n >> k;
    int pres = 0;
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
      pres += (a[i] == k);
    }
    if (pres == 0) {
      cout << "no\n";
      continue;
    }
    if (n == 1) {
      cout << "yes\n";
      continue;
    }
    int yes = 0, less = 0, more = 0, presk = 0;
    for (int i = 1; i <= n; i++) {
      if (a[i] == k) {
        int diff = less - more;
        if (presk and (diff <= 1 and diff >= -2)) yes++;
        less = 0;
        more = 0;
        presk++;
        continue;
      } else if (a[i] < k) {
        less++;
      } else {
        more++;
      }
      if (presk) {
        int curr = (2 + less + more) / 2;
        if (curr == less + 1) yes++;
      }
    }
    less = 0, more = 0, presk = 0;
    for (int i = n; i >= 1; i--) {
      if (a[i] == k) {
        int diff = less - more;
        if (presk and (diff <= 1 and diff >= -2)) yes++;
        less = 0;
        more = 0;
        presk++;
        continue;
      } else if (a[i] < k) {
        less++;
      } else {
        more++;
      }
      if (presk) {
        int curr = (2 + less + more) / 2;
        if (curr == less + 1) yes++;
      }
    }
    for (int i = 1; i <= n - 2; i++) {
      int m = (a[i] >= k) + (a[i + 1] >= k) + (a[i + 2] >= k);
      if (m >= 2) {
        yes++;
      }
    }
    cout << (yes ? "yes\n" : "no\n");
  }
  return 0;
}
