#include <bits/stdc++.h>
using namespace std;
int n, m, t, a[55], b[55];
bool cmp(int k, int p) { return k > p; }
int main() {
  cin >> t;
  while (t--) {
    cin >> n >> m;
    int ok = 1;
    for (int i = 0; i < n; i++) cin >> a[i];
    for (int i = 0; i < n; i++) cin >> b[i];
    sort(b, b + n, cmp);
    for (int i = 0; i < n; i++) {
      if (a[i] + b[i] > m) {
        ok = 0;
        break;
      }
    }
    if (ok)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
