#include <bits/stdc++.h>
using namespace std;
const int M = 1e5 + 20;
const int mod = 1e9 + 7;
int T, n, k;
int a[M], b[M];
int main() {
  scanf("%d", &T);
  while (T--) {
    int ret = 1;
    scanf("%d%d", &n, &k);
    int num = 0;
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      if (a[i] == k) num = i;
    }
    int flag = 0;
    if (n == 1) {
      if (num != 0) {
        printf("YES\n");
        continue;
      }
    } else if (n == 2) {
      if (num != 0 && k == min(a[1], a[2])) {
        printf("YES\n");
        continue;
      }
    }
    if (num != 0)
      for (int i = 1; i <= n; i++) {
        if (a[i] >= k) {
          if (i + 1 <= n) {
            if (a[i + 1] >= k) {
              printf("YES\n");
              flag = 1;
              break;
            } else if (i + 2 <= n) {
              if (a[i + 2] >= k) {
                printf("YES\n");
                flag = 1;
                break;
              }
            }
          }
        }
      }
    if (flag == 0) printf("NO\n");
  }
}
