#include <bits/stdc++.h>
int t, n, a[101], b[101], k;
using namespace std;
bool cmp(int aa, int bb) { return aa > bb; }
int main() {
  scanf("%d", &t);
  while (t--) {
    scanf("%d%d", &n, &k);
    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 + 1 + n);
    sort(b + 1, b + 1 + n, cmp);
    bool p = 1;
    for (int i = 1; i <= n; i++) {
      if (a[i] + b[i] > k) {
        p = 0;
        printf("No\n");
        break;
      }
    }
    if (p) printf("Yes\n");
  }
  return 0;
}
