#include <bits/stdc++.h>
using namespace std;
long long int power(long long int x, unsigned long long int y) {
  long long int res = 1;
  while (y > 0) {
    if (y & 1) {
      res = res * x;
    }
    y = y >> 1;
    x = x * x;
  }
  return res;
}
long long int powermod(long long int x, unsigned long long int y,
                       long long int p) {
  long long int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) {
      res = (res * x) % p;
    }
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
int32_t main() {
  long long int T;
  cin >> T;
  while (T--) {
    long long int n, x;
    cin >> n >> x;
    vector<long long int> a, b;
    for (long long int i = (long long int)(0); i < (long long int)(n); i++) {
      long long int t;
      cin >> t;
      a.push_back(t);
    }
    for (long long int i = (long long int)(0); i < (long long int)(n); i++) {
      long long int t;
      cin >> t;
      b.push_back(t);
    }
    sort((a).begin(), (a).end());
    sort((b).begin(), (b).end());
    reverse((b).begin(), (b).end());
    bool ok = 1;
    for (long long int i = (long long int)(0); i < (long long int)(n); i++) {
      if (a[i] + b[i] > x) ok = 0;
    }
    cout << (ok ? "Yes\n" : "No\n");
  }
  return 0;
}
