#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, x;
    cin >> n >> x;
    vector<long long> a(n, 0);
    vector<long long> b(n, 0);
    for (int i = 0; i < n; i++) cin >> a[i];
    for (int i = 0; i < n; i++) cin >> b[i];
    sort(a.begin(), a.end());
    sort(b.begin(), b.end());
    bool flag = false;
    for (int i = 0, j = n - 1; i < n && j >= 0; i++, j--) {
      if (a[i] + b[j] > x) {
        flag = true;
        break;
      }
    }
    if (flag)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
}
