#include <bits/stdc++.h>
using namespace std;
bool rearrange(int n, int x, int a[], int b[]) {
  sort(b, b + n, greater<int>());
  for (int i = 0; i < n; i++) {
    if (a[i] + b[i] > x) return false;
  }
  return true;
}
int main() {
  int T;
  cin >> T;
  while (T--) {
    int n, x;
    cin >> n >> x;
    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];
    if (rearrange(n, x, a, b))
      cout << "Yes";
    else
      cout << "No";
    cout << endl;
  }
  return 0;
}
