#include <bits/stdc++.h>
int main() {
  int i, m, n, t, a[100010], b, c;
  for (scanf("%d", &t); t--;) {
    scanf("%d%d", &n, &m), b = 0, c = 0;
    for (i = 0; i < n; i++) scanf("%d", &a[i]);
    for (i = 0; i < n; i++)
      b |= a[i] == m, c |= (i < n - 1 && a[i] >= m && a[i + 1] >= m) ||
                           (i < n - 2 && a[i] >= m && a[i + 2] >= m);
    if ((b && c) || (b == n))
      printf("yes\n");
    else
      printf("no\n");
  }
}
