#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int a[N];
int b[N];
bool cmp(int a, int b) { return a > b; }
int main() {
  int t;
  int n, x, fl;
  cin >> t;
  while (t--) {
    fl = 0;
    cin >> n >> x;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }
    for (int j = 0; j < n; j++) {
      cin >> b[j];
    }
    sort(b, b + n, cmp);
    for (int i = 0; i < n; i++) {
      if ((b[i] + a[i]) > x) {
        fl = 1;
      }
    }
    if (fl == 0)
      printf("YES\n");
    else {
      printf("NO\n");
    }
  }
}
