#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
void solve() {
  int n, x;
  cin >> n >> x;
  vector<int> a(n), b(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
  }
  bool ok = 1;
  for (int i = 0; i < n; i++) {
    ok &= (a[i] + b[n - 1 - i] <= x);
  }
  cout << (ok ? "Yes" : "No") << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int TC = 1;
  cin >> TC;
  for (int i = 1; i <= TC; i++) {
    solve();
  }
  return 0;
}
