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