#include <bits/stdc++.h>
using namespace std;
void _main();
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  _main();
}
const int inf = INT_MAX / 2;
const long long infl = 1LL << 60;
template <class T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T& a, const T& b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
int N, K, A[101010];
bool check() {
  int tot = -inf / 2;
  for (int i = 0; i < N; i++) {
    if (A[i] == 0)
      tot = 0;
    else {
      tot += A[i];
      if (0 <= tot) return true;
    }
  }
  return false;
}
void solve() {
  cin >> N >> K;
  for (int i = 0; i < N; i++) cin >> A[i];
  for (int i = 0; i < N; i++) {
    if (A[i] < K)
      A[i] = -1;
    else if (A[i] == K)
      A[i] = 0;
    else
      A[i] = 1;
  }
  bool ok = false;
  for (int i = 0; i < N; i++)
    if (A[i] == 0) ok = true;
  if (!ok) {
    printf("no\n");
    return;
  }
  bool ans = false;
  if (N == 1 && A[0] == 0) ans = true;
  for (int i = 0; i < N - 1; i++)
    if (A[i] == 0 && A[i + 1] == 0) ans = true;
  ans |= check();
  reverse(A, A + N);
  ans |= check();
  for (int i = 0; i < N - 1; i++)
    if (A[i] == 1 && A[i + 1] == 1) ans = true;
  for (int i = 0; i < N - 2; i++)
    if (A[i] == 1 && A[i + 1] == -1 && A[i + 2] == 1) ans = true;
  for (int i = 0; i < N - 2; i++)
    if (A[i] == 0 && A[i + 1] == -1 && A[i + 2] == 0) ans = true;
  if (ans)
    printf("yes\n");
  else
    printf("no\n");
}
void _main() {
  int T;
  cin >> T;
  for (int t = 0; t < T; t++) solve();
}
