#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t, x, n;
  cin >> t;
  while (t--) {
    bool ok = false;
    cin >> n >> x;
    vector<long long> a(n), b(n);
    for (auto &i : a) cin >> i;
    for (auto &it : b) cin >> it;
    sort(a.rbegin(), a.rend());
    sort(b.begin(), b.end());
    for (int i = 0; i < n; i++) {
      if (a[i] + b[i] <= x)
        ok = 1;
      else {
        ok = 0;
        break;
      }
    }
    if (ok)
      cout << "Yes"
           << "\n";
    else
      cout << "No"
           << "\n";
  }
}
