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