#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  cin >> t;
  while (t--) {
    long long n, x;
    cin >> n >> x;
    vector<long long> v1(n, 0), v2(n, 0);
    for (long long i = 0; i < n; i++) cin >> v1[i];
    for (long long i = 0; i < n; i++) cin >> v2[i];
    sort((v1).begin(), (v1).end());
    sort((v2).begin(), (v2).end());
    for (long long i = 0; i < n; i++) {
      if (v1[i] + v2[n - i - 1] > x) goto h;
    }
    cout << "Yes\n";
    goto p;
  h:;
    for (long long i = 0; i < n; i++) {
      if (v1[n - i - 1] + v2[i] > x) {
        cout << "No\n";
        goto p;
      }
    }
    cout << "Yes\n";
  p:;
  }
}
