#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    int present = false;
    int less_present = false;
    int more_present = false;
    for (int i = 0; i < a.size(); ++i) {
      cin >> a[i];
      if (a[i] < k) {
        a[i] = -1;
        less_present = true;
      }
      if (a[i] == k) {
        a[i] = 0;
        present = true;
      }
      if (a[i] > k) {
        a[i] = 1;
        more_present = true;
      }
    }
    int min_dis = max(n, 3);
    int last_location = -1;
    for (int i = 0; i < a.size(); ++i) {
      if (a[i] >= 0) {
        if (last_location != -1) {
          min_dis = min(min_dis, i - last_location);
        }
        last_location = i;
      }
    }
    if (present && ((less_present && min_dis <= 2) || (!less_present))) {
      cout << "yes" << endl;
    } else {
      cout << "no" << endl;
    }
  }
  return 0;
}
