#include <bits/stdc++.h>
using namespace std;
int main() {
  long long ih, num, test, x, c;
  cin >> test;
  while (test--) {
    c = 0;
    cin >> num;
    cin >> x;
    long a[num], b[num];
    for (ih = 0; ih < num; ih++) cin >> a[ih];
    for (ih = 0; ih < num; ih++) cin >> b[ih];
    sort(a, a + num);
    sort(b, b + num);
    reverse(b + 0, b + num);
    for (ih = 0; ih < num; ih++)
      if (a[ih] + b[ih] > x) {
        cout << "NO\n";
        c++;
        break;
      }
    if (c == 0) cout << "YES\n";
  }
}
