#include <bits/stdc++.h>
using namespace std;
bool cond(int x, int y) { return x > y; }
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, x;
    cin >> n >> x;
    int a[51], b[51];
    int i;
    for (i = 1; i <= n; i++) cin >> a[i];
    for (i = 1; i <= n; i++) cin >> b[i];
    sort(a + 1, a + n + 1);
    sort(b + 1, b + n + 1, cond);
    int ok = 1;
    for (i = 1; i <= n; i++)
      if (a[i] + b[i] > x) ok = 0;
    if (ok)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
