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