#include <bits/stdc++.h>
using namespace std;
int main() {
  ios ::sync_with_stdio(false);
  cin.tie(nullptr);
  int T = 1;
  cin >> T;
  int cases = 0;
  while (T--) {
    cases++;
    int n, x;
    cin >> n >> x;
    vector<int> a(n), b(n);
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }
    for (int i = 0; i < n; i++) {
      cin >> b[i];
    }
    sort(a.begin(), a.end());
    sort(b.rbegin(), b.rend());
    bool ok = true;
    for (int i = 0; i < n; i++) {
      if (a[i] + b[i] > x) {
        ok = false;
      }
    }
    if (ok) {
      cout << "Yes";
    } else {
      cout << "No";
    }
    cout << endl;
  }
}
