#include <bits/stdc++.h>
int main() {
  int t;
  std::cin >> t;
  while (t--) {
    int n, x;
    std::cin >> n >> x;
    int a[n], b[n];
    for (int i = 0; i < n; ++i) std::cin >> a[i];
    for (int i = 0; i < n; ++i) std::cin >> b[i];
    std::sort(a, a + n);
    std::sort(b, b + n);
    bool flag = false;
    for (int i = 0; i < n; ++i) {
      if (a[i] + b[n - 1 - i] > x) {
        flag = true;
        break;
      }
    }
    std::cout << ((flag) ? "No" : "Yes") << "\n";
  }
}
