#include <bits/stdc++.h>
using namespace std;
const int N = 510;
int x, y, z, ans, n, m, k, flag, flag2;
int a[1000005], b[100005];
void solve() {
  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);
  reverse(a, a + n);
  sort(b, b + n);
  for (int i = 0; i < n; ++i) {
    if (a[i] + b[i] > x) {
      cout << "No" << endl;
      return;
    }
  }
  cout << "Yes" << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int T;
  cin >> T;
  while (T--) solve();
  return 0;
}
