#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  long long t, n, m, x;
  cin >> t;
  while (t--) {
    multiset<long long> a, b;
    cin >> n >> x;
    long long tmp;
    for (int i = 0; i < n; ++i) {
      cin >> tmp;
      a.insert(tmp);
    }
    for (int i = 0; i < n; ++i) {
      cin >> tmp;
      b.insert(tmp);
    }
    while (!a.empty()) {
      if (*a.begin() + *(--b.end()) > x) {
        cout << "No" << endl;
        tmp = -1e9;
        break;
      }
      a.erase(a.begin());
      b.erase(--b.end());
    }
    if (tmp != -1e9) {
      cout << "Yes" << endl;
    }
  }
  return 0;
}
