#include <bits/stdc++.h>
using namespace std;
int fx[] = {0, 0, 1, -1, 1, 1, -1, -1};
int fy[] = {1, -1, 0, 0, -1, 1, -1, 1};
const int mxn = 1e9 + 7;
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(0);
  long long test;
  cin >> test;
  while (test--) {
    int n, x;
    cin >> n >> x;
    vector<int> a(n), b(n);
    for (auto &i : a) cin >> i;
    for (auto &i : b) cin >> i;
    sort(b.rbegin(), b.rend());
    bool flag = true;
    for (int i = 0; i < n; i++) {
      if (a[i] + b[i] > x) flag = false;
    }
    cout << (flag ? "YES" : "NO") << '\n';
  }
}
