#include <bits/stdc++.h>
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, i, x, f = 0;
    cin >> n >> x;
    long long int a[n], b[n];
    for (i = 0; i < n; i++) cin >> a[i];
    for (i = 0; i < n; i++) cin >> b[i];
    sort(a, a + n);
    sort(b, b + n, greater<long long int>());
    for (i = 0; i < n; i++) {
      if (a[i] + b[i] > x) {
        f = 1;
        break;
      }
    }
    if (f)
      cout << "No";
    else
      cout << "Yes";
    cout << '\n';
  }
  return 0;
}
