#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int a[105], b[105], n, x;
    bool flg = 1;
    cin >> n >> x;
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1; i <= n; i++) cin >> b[i];
    sort(a + 1, a + 1 + n);
    sort(b + 1, b + 1 + n);
    for (int i = 1; i <= n; i++) {
      if (a[i] + b[n + 1 - i] > x) flg = 0;
    }
    if (flg)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
