#include <bits/stdc++.h>
using namespace std;
void work() {
  int n, x;
  cin >> n >> x;
  int a[502], b[502];
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= n; i++) {
    cin >> b[i];
  }
  for (int i = 1; i <= n; i++) {
    int temp = x - a[i];
    int maxn = -99;
    int ind = -1;
    for (int j = i; j <= n; j++) {
      if (b[j] <= temp) {
        if (b[j] > maxn) {
          maxn = b[j];
          ind = j;
        }
      }
    }
    if (maxn == -99) {
      cout << "No" << endl;
      return;
    }
    int t = b[ind];
    b[ind] = b[i];
    b[i] = t;
  }
  cout << "Yes" << endl;
}
int main() {
  int t;
  cin >> t;
  for (int i = 1; i <= t; i++) {
    work();
  }
}
