#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n, x;
    cin >> n >> x;
    vector<int> a(n), b(n);
    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.rbegin(), b.rend());
    int f = 0;
    for (int i = 0; i < n; i++) {
      if (a[i] + b[i] > x) {
        f = 1;
        break;
      }
    }
    if (f)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
}
