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