#include <bits/stdc++.h>
using namespace std;
int main() {
  int T0;
  cin >> T0;
  while (T0--) {
    int n, x;
    cin >> n >> x;
    int a[n], b[n];
    for (int i = 0; i < n; i++) cin >> a[i];
    for (int i = 0; i < n; i++) cin >> b[i];
    sort(a, a + n);
    sort(b, b + n);
    bool ok = 1;
    for (int i = 0; ok && i < n; i++) {
      if (a[i] + b[n - 1 - i] > x) {
        cout << "No\n";
        ok = 0;
      }
    }
    if (ok) cout << "Yes\n";
  }
  return 0;
}
