#include <bits/stdc++.h>
using namespace std;
long long b1[55], b2[55];
void sol() {
  memset(b1, 0, sizeof(b1));
  memset(b2, 0, sizeof(b2));
  long long a, x;
  cin >> a >> x;
  for (long long i = 1; i <= a; i++) {
    cin >> b1[i];
  }
  for (long long i = 1; i <= a; i++) {
    cin >> b2[i];
  }
  sort(b1 + 1, b1 + a + 1);
  sort(b2 + 1, b2 + 1 + a, greater<int>());
  for (long long i = 1; i <= a; i++) {
    if (b1[i] + b2[i] > x) {
      cout << "NO" << endl;
      return;
    }
  }
  cout << "YES" << endl;
}
int main() {
  long long t;
  cin >> t;
  while (t--) {
    sol();
  }
}
