#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
int main(int argc, char *argv[]) {
  int T;
  scanf("%d", &T);
  while (T--) {
    int N, x;
    scanf("%d %d", &N, &x);
    vector<int> a(N);
    vector<int> b(N);
    for (int i = 0; i < N; ++i) {
      scanf("%d", &a[i]);
    }
    for (int i = 0; i < N; ++i) {
      scanf("%d", &b[i]);
    }
    sort((b).begin(), (b).end());
    sort((a).begin(), (a).end(), greater<int>());
    bool can_do = true;
    for (int i = 0; i < a.size(); ++i) {
      if (a[i] + b[i] > x) {
        can_do = false;
        break;
      }
    }
    if (!can_do)
      printf("No\n");
    else
      printf("Yes\n");
  }
  return 0;
}
