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