text: // Optimise
  #include <bits/stdc++.h>
  using namespace std;
  
  #ifdef LOCAL
  #include "/home/shahraaz/bin/debug.h"
  #else
  #define db(...)
  #endif
  
  using ll = long long;
  #define f first
  #define s second
  #define pb push_back
  #define all(v) v.begin(), v.end()
  
  const int NAX = 2e5 + 5, MOD = 1000000007;
  
  void solveCase()
  {
      int n, x;
      cin >> n >> x;
      vector<int> a(n), b(n);
      for (auto &x : a)
          cin >> x;
      for (auto &x : b)
          cin >> x;
      reverse(all(a));
      for (size_t i = 0; i < n; i++)
      {
          if (a[i] + b[i] > x)
          {
              cout << "No\n";
              return;
          }
      }
      cout << "Yes\n";
  }
  
  int32_t main()
  {
  #ifndef LOCAL
      ios_base::sync_with_stdio(0);
      cin.tie(0);
  #endif
      int t = 1;
      sort(all(a));
      cin >> t;
      for (int i = 1; i <= t; ++i)
      {
          solveCase();
  #ifdef LOCAL
          cerr << "Case #" << i << ": Time " << chrono::duration<double>(chrono::steady_clock::now() - TimeStart).count() << " s.\n";
          TimeStart = chrono::steady_clock::now();
  #endif
      }
      return 0;
  }
  