#include <bits/stdc++.h>
using namespace std;
int a[100], b[100];
int main() {
  int c, n, m;
  cin >> c;
  while (c--) {
    cin >> n >> m;
    for (int i = 0; i < n; i++) cin >> a[i];
    sort(a, a + n);
    for (int i = 0; i < n; i++) cin >> b[i];
    sort(b, b + n);
    int f = 1;
    for (int i = 0; i < n; i++) {
      if (b[i] + a[n - 1 - i] > m) {
        f = 0;
        break;
      }
    }
    if (f == 1)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
