#include <bits/stdc++.h>
using namespace std;
const long long int mx = 1e6 + 10;
int t, n, a[mx], b[mx], x;
bool bb;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> t;
  while (t--) {
    cin >> n >> x;
    for (long long int i = 0; i < n; i++) cin >> a[i];
    for (long long int i = 0; i < n; i++) cin >> b[i];
    sort(a, a + n);
    sort(b, b + n);
    for (long long int i = 0; i < n; i++) {
      if (a[i] + b[n - i - 1] > x) {
        bb = true;
        break;
      }
    }
    (bb == true) ? cout << "No\n" : cout << "Yes\n";
    bb = false;
  }
  return 0;
}
