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