#include <bits/stdc++.h>
using namespace std;
const long long N = 1e3 + 5;
long long t, n, x, a[N], b[N];
bool solve() {
  for (long long i = 1; i <= n; i++)
    if (a[i] + b[i] > x) return 0;
  return 1;
}
signed main() {
  scanf("%lld", &t);
  while (t--) {
    scanf("%lld%lld", &n, &x);
    for (long long i = 1; i <= n; i++) scanf("%lld", &a[i]);
    for (long long i = 1; i <= n; i++) scanf("%lld", &b[i]);
    sort(a + 1, a + 1 + n), sort(b + 1, b + 1 + n, greater<long long>());
    puts(solve() ? "Yes" : "No");
  }
  return 0;
}
