#include <bits/stdc++.h>
using namespace std;
const int M = (int)1e4;
const int N = (int)1e5;
const double eps = 1e-9;
const int inf = 0x3f3f3f3f;
const long long mod = (long long)998244353;
int n, x, a[M + 5], b[M + 5];
void work() {
  scanf("%d %d", &n, &x);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  for (int i = 1; i <= n; ++i) scanf("%d", &b[i]);
  sort(a + 1, a + n + 1);
  sort(b + 1, b + n + 1);
  reverse(b + 1, b + n + 1);
  for (int i = 1; i <= n; ++i)
    if (a[i] + b[i] > x) {
      printf("No\n");
      return;
    }
  printf("Yes\n");
}
int main() {
  int T;
  scanf("%d", &T);
  while (T--) work();
  return 0;
}
