#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n, x;
  cin >> t;
  while (t--) {
    cin >> n >> x;
    int val;
    vector<int> a;
    vector<int> b;
    for (int i = 0; i < n; i++) {
      cin >> val;
      a.push_back(val);
    }
    for (int i = 0; i < n; i++) {
      cin >> val;
      b.push_back(val);
    }
    sort(a.begin(), a.end());
    sort(b.begin(), b.end(), greater<int>());
    int flag = 0;
    for (int i = 0; i < n; i++) {
      if (a[i] + b[i] > x) {
        cout << "No\n";
        flag = 1;
        break;
      }
    }
    if (flag == 0) {
      cout << "Yes\n";
    }
  }
  return 0;
}
