#include <bits/stdc++.h>
using namespace std;
unsigned long long int power(unsigned long long int x,
                             unsigned long long int y) {
  unsigned long long int res = 1;
  while (y > 0) {
    if ((y & 1) % 998244353)
      res = ((res % 998244353) * (x % 998244353)) % 998244353;
    y = ((y % 998244353) >> (1ul)) % 998244353;
    x = ((x % 998244353) * (x % 998244353)) % 998244353;
  }
  return (res % 998244353);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    long long int c = 0, n, k, r, s1 = 1, t1 = 0, t2 = 0, c1 = 0, c2 = 0,
                  c3 = 0;
    cin >> n >> k;
    long long int a[n], b[n], s2 = 0;
    vector<long long int> v, v3, v4, v7;
    vector<pair<long long int, long long int>> v1, v5;
    vector<pair<long long int, pair<long long int, long long int>>> v2;
    unordered_map<long long int, long long int> mp;
    set<long long int> s4, s5;
    for (long long int i = 0; i < n; i++) {
      cin >> a[i];
    }
    for (long long int i = 0; i < n; i++) {
      cin >> b[i];
    }
    sort(a, a + n);
    sort(b, b + n);
    reverse(b, b + n);
    for (long long int i = 0; i < n; i++) {
      if ((a[i] + b[i]) <= k)
        c++;
      else
        break;
    }
    if (c == n) {
      cout << "Yes\n";
    } else
      cout << "No\n";
  }
  return 0;
}
