#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  cin.sync_with_stdio(0);
  int t;
  cin >> t;
  while (t--) {
    int n, x;
    cin >> n >> x;
    vector<int> a(n);
    vector<int> b(n);
    for (int &ai : a) cin >> ai;
    for (int &bi : b) cin >> bi;
    sort((a).begin(), (a).end());
    sort((b).begin(), (b).end());
    reverse((b).begin(), (b).end());
    bool good = true;
    for (int i = 0; i < n; i++) {
      good &= (a[i] + b[i] <= x);
    }
    cout << (good ? "Yes\n" : "No\n");
  }
}
