#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long n, p, q, i, x, k = 1;
    cin >> n >> x;
    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<int>());
    for (i = 0; i < n; i++) {
      if (a[i] + b[i] > x) k = 0;
    }
    if (k == 1)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
