#include <bits/stdc++.h>
using namespace std;
long long int x[10010], y[10010];
void solve() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x[i]);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &y[i]);
  }
  sort(x + 1, x + 1 + n);
  sort(y + 1, y + 1 + n);
  reverse(y + 1, y + 1 + n);
  for (int i = 1; i <= n; i++) {
    if (x[i] + y[i] > m) {
      cout << "No" << endl;
      return;
    }
  }
  cout << "Yes" << endl;
  return;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
