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