#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, x;
  cin >> n >> x;
  int ar[n + 5], br[n + 5];
  for (int i = 0; i < n; i++) cin >> ar[i];
  for (int j = 0; j < n; j++) cin >> br[j];
  sort(ar, ar + n);
  sort(br, br + n);
  reverse(br, br + n);
  int tr = 0;
  for (int i = 0; i < n; i++) {
    if (ar[i] + br[i] > x) tr = 1;
  }
  if (!tr)
    printf("Yes\n");
  else
    printf("No\n");
}
int main() {
  int tst = 1;
  cin >> tst;
  while (tst--) {
    solve();
  }
  return 0;
}
