#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n, x;
    cin >> n >> x;
    long long a[n];
    long long b[n];
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
    }
    for (long long i = 0; i < n; i++) {
      cin >> b[i];
    }
    int f = 1;
    sort(a, a + n);
    sort(b, b + n, greater<int>());
    for (int i = 0; i < n; i++) {
      if (a[i] + b[i] > x) {
        f = 0;
        break;
      } else
        continue;
    }
    if (f == 0)
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  }
}
