#include <bits/stdc++.h>
using namespace std;
const long long N = 200020;
long long memory = 0, tim = 0, ttt = 0;
vector<long long> factorialNumInverse, naturalNumInverse, fact, prime;
void SieveOfEratosthenes(long long n) {
  bool Prime[n + 1];
  memset(Prime, true, sizeof(Prime));
  for (long long p = 2; p * p <= n; p++) {
    if (Prime[p] == true) {
      for (long long i = p * p; i <= n; i += p) Prime[i] = false;
    }
  }
  for (long long p = 2; p <= n; p++)
    if (Prime[p]) prime[p] = 1;
}
vector<long long> primefactors(long long n) {
  vector<long long> fac;
  long long i;
  for (i = 2; i <= sqrt(n) + 1; i++) {
    while (n % i == 0) {
      n = n / i;
      fac.push_back(i);
    }
  }
  if (n != 1) fac.push_back(n);
  return fac;
}
bool isprime(long long n) {
  long long i;
  if (n == 1) return false;
  for (i = 2; i <= sqrt(n); i++) {
    if (n % i == 0) {
      return false;
    }
  }
  return true;
}
long long kbit(long long a, long long b) {
  long long k = (long long)1 << (b - 1);
  if ((a & k) == 0)
    return 0;
  else
    return 1;
}
void inputstring(string &s) {
  cin >> s;
  s = ' ' + s;
}
long long spacestring = 0;
void inputspacestring(string &s) {
  if (spacestring == 0)
    cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
  getline(cin, s);
  spacestring = 1;
}
void print(long long value) {
  cout << "Value"
       << " is " << value << "\n";
}
void print(vector<long long> &v) {
  long long i;
  cout << "Vector " << v.size() << "\n";
  for (i = 0; i < v.size(); i++) {
    cout << v[i] << " ";
  }
  cout << "\n";
}
void print(vector<pair<long long, long long>> &v) {
  long long i;
  cout << "Vector pair" << v.size() << "\n";
  for (i = 0; i < v.size(); i++) {
    cout << v[i].first << " " << v[i].second << "\n";
  }
  cout << "\n";
}
void print(vector<vector<long long>> &graph1, long long n) {
  cout << "GRAPH"
       << "\n\n";
  for (long long i = 0; i <= n; i++) {
    cout << i << " -> ";
    for (auto it : graph1[i]) {
      cout << it << " ";
    }
    cout << "\n";
  }
}
long long power(long long a, long long b) {
  long long k = 1, i;
  for (i = 1; i <= b; i++) {
    k = k * a;
  }
  return k;
}
long long fastpower(long long x, long long y) {
  if (y == 0) return 1;
  long long p = fastpower(x, y / 2) % 998244353;
  p = (p * p) % 998244353;
  return (y % 2 == 0) ? p : (x * p) % 998244353;
}
long long modInverse(long long a) { return fastpower(a, 998244353 - 2); }
void InverseofNumber() {
  naturalNumInverse[0] = naturalNumInverse[1] = 1;
  for (long long i = 2; i <= N; i++)
    naturalNumInverse[i] = naturalNumInverse[998244353 % i] *
                           (998244353 - 998244353 / i) % 998244353;
}
void InverseofFactorial() {
  factorialNumInverse[0] = factorialNumInverse[1] = 1;
  for (long long i = 2; i <= N; i++)
    factorialNumInverse[i] =
        (naturalNumInverse[i] * factorialNumInverse[i - 1]) % 998244353;
}
void factorial() {
  fact[0] = 1;
  for (long long i = 1; i <= N; i++) {
    fact[i] = (fact[i - 1] * i) % 998244353;
  }
}
long long binomial(long long n, long long r) {
  if (n < r) return 0;
  long long ans = ((fact[n] * factorialNumInverse[r]) % 998244353 *
                   factorialNumInverse[n - r]) %
                  998244353;
  return ans;
}
void bfs(vector<vector<long long>> &adj, long long u, vector<long long> &vis) {
  long long x, i, f;
  queue<long long> q;
  q.push(u);
  vis[u] = 1;
  while (!q.empty()) {
    f = q.front();
    q.pop();
    for (i = 0; i < adj[f].size(); i++) {
      x = adj[f][i];
      if (vis[x] == 0) {
        q.push(x);
        vis[x] = 1;
      }
    }
  }
}
bool sortbysec(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.second == b.second) return a.first < b.first;
  return a.second < b.second;
}
void dfs(vector<vector<long long>> &adj, long long u, vector<long long> &vis) {
  long long i, x;
  vis[u] = 1;
  for (i = 0; i < adj[u].size(); i++) {
    x = adj[u][i];
    if (vis[x] == 0) {
      dfs(adj, x, vis);
    }
  }
}
void funofdiv() {
  long long n = 0, m = 0, i, j, k = 0, l = 0, mini = LLONG_MAX, maxi = 0,
            ans = 0, sum = 0, sum2 = 0;
  long long x = 0, y = 0, z = 0, f = 0, g = 0, h = 0, p = -1, q, r;
  cin >> n >> k;
  vector<long long> a(1, 0), b(1, 0), c(1, 0), d(1, 0);
  for (i = 1; i <= n; i++) {
    cin >> x;
    a.push_back(x);
  }
  for (i = 1; i <= n; i++) {
    cin >> x;
    b.push_back(x);
  }
  sort(a.begin() + 1, a.end());
  sort(b.begin() + 1, b.end());
  reverse(a.begin() + 1, a.end());
  for (i = 1; i <= n; i++) {
    if (a[i] + b[i] > k) {
      cout << "NO\n";
      return;
    }
  }
  cout << "YES\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long num = 1, i;
  cin >> num;
  for (i = 1; i <= num; i++) {
    funofdiv();
  }
  return 0;
}
