#include <bits/stdc++.h>
using namespace std;
const long long ars = 1e6 + 1507;
bool used[123];
long long n;
vector<long long> a(9);
void solve(long long tc = 0) {
  long long n, k;
  bool ok = 1;
  cin >> n >> k;
  vector<long long> a(n), 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(a.begin(), a.end());
  sort(b.rbegin(), b.rend());
  for (long long i = 0; i < n; i++) {
    if (a[i] + b[i] > k) {
      ok = 0;
      break;
    }
  }
  cout << ((ok) ? "Yes" : "No") << '\n';
}
signed main() {
  { ios_base::sync_with_stdio(false); }
  {
    cin.tie(NULL);
    cout.tie(NULL);
  }
  long long tc = 1;
  cin >> tc;
  for (long long i = 0; i < tc; i++) solve(i);
}
