#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 50;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const int HASH = 131;
int a[maxn];
int b[maxn];
bool cmp(int a, int b) { return a > b; }
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, x;
    cin >> n >> x;
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
    }
    for (int i = n; i >= 1; i--) {
      cin >> b[i];
    }
    sort(a + 1, a + 1 + n);
    sort(b + 1, b + 1 + n, cmp);
    int sign = 0;
    for (int i = 1; i <= n; i++) {
      if (a[i] + b[i] > x) sign = 1;
    }
    if (sign == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
