#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int t;
  cin >> t;
  while (t--) {
    int n, x;
    cin >> n >> x;
    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];
    }
    sort(b, b + n, greater<int>());
    bool m = 0;
    for (int i = 0; i < n; i++) {
      if (a[i] + b[i] > x) {
        cout << "No\n";
        m = 1;
        break;
      }
    }
    if (!m) cout << "Yes\n";
  }
}
