#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n, x;
    cin >> n >> x;
    vector<long long> a(n), b(n);
    vector<pair<long long, long long>> arr;
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      arr.push_back({a[i], i});
    }
    for (long long i = 0; i < n; i++) {
      cin >> b[i];
    }
    sort(arr.begin(), arr.end());
    sort(b.begin(), b.end(), greater<long long>());
    bool possible = true;
    for (long long i = 0; i < n; i++) {
      if ((a[arr[i].second] + b[i]) > x) {
        possible = false;
        break;
      }
    }
    if (possible) {
      cout << "Yes\n";
    } else {
      cout << "No\n";
    }
  }
  return 0;
}
