#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t, n, i, j, k, a;
  cin >> t;
  while (t--) {
    cin >> n >> k;
    std::vector<int> v;
    std::vector<int> v1;
    for (i = 0; i < n; i++) {
      cin >> a;
      v.push_back(a);
    }
    for (i = 0; i < n; i++) {
      cin >> a;
      v1.push_back(a);
    }
    sort(v.begin(), v.end());
    sort(v1.rbegin(), v1.rend());
    bool flag = false;
    for (i = 0; i < n; i++) {
      if (v[i] + v1[i] <= k) {
        continue;
      } else {
        flag = true;
        break;
      }
    }
    if (flag)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
  return 0;
}
