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