#include <bits/stdc++.h>
using namespace std;
int read() {
  int rt = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    rt = (rt << 3) + (rt << 1) + ch - '0';
    ch = getchar();
  }
  return rt * f;
}
const int maxn = 55;
int T, n, a[maxn], b[maxn], x;
int main() {
  T = read();
  while (T--) {
    n = read(), x = read();
    for (int i = 1; i <= n; i++) a[i] = read();
    for (int i = 1; i <= n; i++) b[i] = read();
    sort(a + 1, a + 1 + n);
    sort(b + 1, b + 1 + n);
    bool flag = 1;
    for (int i = 1; i <= n; i++) {
      if (a[i] + b[n - i + 1] > x) {
        flag = 0;
        break;
      }
    }
    if (flag) {
      puts("Yes");
    } else {
      puts("No");
    }
  }
  return 0;
}
