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