#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
int main()
{
int t;
cin>>t;
for(int k = 0; k < t; ++k ){
int n,num;
cin>>n>>num;
vector<int> a(n), b(n);
for(int i = 0; i < n; ++i){
cin>>a[i];
}
for(int i = 0; i < n; ++i){
cin>>b[i];
}
sort( b.begin(), b.end());
vector<bool> mark(n, false);
for(int i = 0; i < n; ++i){
for(int j = 0; j < n; ++j){
if( mark[j] == false && a[i]+b[j]>=num){
mark[j] = true;
break;
}
}
}
string ans = "YES";
for(int i = 0; i < n; ++i){
if( mark[i] == false){
ans = "NO";
break;
}
}
cout<<ans<<endl;
}
// your code goes here
return 0;
}