#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 10;
int n, m, a[N], b[N];
int main() {
  int tt;
  cin >> tt;
  while (tt--) {
    cin >> n >> m;
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1; i <= n; i++) cin >> b[i];
    sort(a + 1, a + n + 1);
    sort(b + 1, b + n + 1);
    reverse(a + 1, a + n + 1);
    bool bk = 1;
    for (int i = 1; i <= n; i++)
      if (a[i] + b[i] > m) {
        bk = 0;
        break;
      }
    puts(bk ? "Yes" : "No");
  }
  return 0;
}
