#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const double eps = 1e-9;
const double PI = acos(-1);
const int maxn = 1e5 + 5;
int t;
int a[maxn], b[maxn];
void slove() {
  int n, x;
  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 + n + 1);
  sort(b + 1, b + n + 1);
  reverse(b + 1, b + n + 1);
  for (int i = 1; i <= n; i++) {
    if (a[i] + b[i] > x) {
      cout << "No\n";
      return;
    }
  }
  cout << "Yes\n";
}
int main() {
  ios::sync_with_stdio(0);
  t = 1;
  cin >> t;
  while (t--) slove();
  return 0;
}
