#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n, x;
    cin >> n >> x;
    long long a[n], b[n];
    for (long long i = 0; i < n; i++) cin >> a[i];
    for (long long i = 0; i < n; i++) cin >> b[i];
    sort(a, a + n, greater<long long>());
    bool flag = true;
    for (long long i = 0; i < n; i++) {
      if (a[i] + b[i] > x) {
        flag = false;
        break;
      }
    }
    if (flag)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
}
