#include <bits/stdc++.h>
const int maxn = 105;
using namespace std;
int A[maxn], B[maxn];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int T;
  cin >> T;
  while (T--) {
    int n, x;
    cin >> n >> x;
    for (int i = 1; i <= n; i++) {
      cin >> A[i];
    }
    for (int i = 1; i <= n; i++) {
      cin >> B[i];
    }
    sort(A + 1, A + 1 + n);
    sort(B + 1, B + 1 + n, [](int a, int b) { return a > b; });
    bool fg = 0;
    for (int i = 1; i <= n; i++) {
      if (A[i] + B[i] > x) fg = 1;
    }
    cout << (fg == 0 ? "Yes\n" : "No\n");
  }
}
