#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int test;
  cin >> test;
  while (test--) {
    int dem = 0;
    int a[100001], b[100001], n, x;
    cin >> n >> x;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }
    for (int i = 0; i < n; i++) {
      cin >> b[i];
    }
    sort(a, a + n);
    sort(b, b + n, greater<int>());
    for (int i = 0; i < n; i++) {
      if (a[i] + b[i] > x) {
        dem++;
      }
    }
    if (dem == 0) cout << "Yes" << '\n';
    if (dem != 0) cout << "No" << '\n';
  }
}
