#include <bits/stdc++.h>
inline int read() {
  register int x = 0, fh = 1;
  register char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') fh = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + (ch ^ 48);
    ch = getchar();
  }
  return x * fh;
}
const int maxn = 1005;
int t, a[maxn], b[maxn], n, x;
bool vis[maxn], jud;
int main() {
  t = read();
  while (t--) {
    memset(vis, 0, sizeof(vis));
    n = read(), x = read();
    jud = 0;
    for (register int i = 1; i <= n; i++) {
      a[i] = read();
    }
    for (register int i = 1; i <= n; i++) {
      b[i] = read();
    }
    std::sort(a + 1, a + 1 + n);
    std::sort(b + 1, b + 1 + n);
    for (register int i = 1; i <= n; i++) {
      register bool pd = 0;
      for (register int j = n; j >= 1; j--) {
        if (vis[j] || a[i] + b[j] > x) continue;
        pd = 1;
        vis[j] = 1;
        break;
      }
      if (!pd) jud = 1;
    }
    if (jud)
      printf("No\n");
    else
      printf("Yes\n");
  }
  return 0;
}
