#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long power(long long a, long long b, long long n) {
  long long ans = 1;
  a = a % n;
  while (b > 1) {
    if (b & 1) ans = (ans * a) % n;
    a = (a * a) % n;
    b >>= 1;
  }
  return ans;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, x;
    cin >> n >> x;
    int a[n], b[n];
    for (int i = 0; i < n; i++) cin >> a[i];
    for (int j = 0; j < n; j++) cin >> b[j];
    sort(a, a + n);
    sort(b, b + n);
    int i = 0, j = n - 1;
    bool flag = true;
    while (i < n) {
      if ((a[i] + b[j]) > x) {
        cout << "No\n";
        flag = false;
        break;
      }
      i++;
      j--;
    }
    if (flag) cout << "Yes\n";
  }
  return 0;
}
