#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);
}
map<long long, bool> m;
void sieve() {
  m[0] = 1;
  m[1] = 1;
  for (long long i = 2; i < 1000; i++) {
    if (m[i] == 0) {
      for (long long j = i + i; j < 1000; j += i) m[j] = 1;
    }
  }
}
void solve() {
  long long n, x, i;
  cin >> n >> x;
  long long a[n], 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);
  reverse(b, b + n);
  bool flag = 1;
  for (i = 0; i < n; i++) {
    if (a[i] + b[i] > x) {
      flag = 0;
      break;
    }
  }
  if (!flag)
    cout << "No";
  else
    cout << "Yes";
  cout << "\n";
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) solve();
  return 0;
}
