#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
void solve() {
  int n, x, i;
  cin >> n;
  cin >> x;
  vector<int> a(n), b(n);
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < n; i++) cin >> b[i];
  bool check = true;
  for (int j = 0, k = n - 1; j < n; j++, k--) {
    if (a[j] + b[k] > x) check = false;
  }
  puts(check ? "Yes" : "No");
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
