#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N = 2e5+10;
int n, m;
struct node{
int l, r, s;
}stN;
bool cmp(node x, node y){
return x.l < y.l;
}
void solve(){
int cnt = 0;
cin >> n >> m;
for(int i = 0; i < n; i ++){
int x, y;
cin >> x >> y;
stcnt ++ = {x, y, 1};
}
for(int i = 0; i < m; i ++){
int x, y;
cin >> x >> y;
stcnt ++ = {x, y, 0};
}
sort(st, st+cnt, cmp);
for(int i = 1; i < cnt; i ++){
if(sti.l < sti-1.r){
cout << "No\n";
return ;
}
}
int x = 0;
for(int i = 0; i < cnt; i ++){
if(sti.s)
{
if(x < sti.r)
{
cout << "No\n";
return ;
}
}
else
{
x = sti.r+2*(sti.r-sti.l);
}
}
cout << "Yes\n";
}
signed main(){
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
int T = 1;
cin >> T;
while(T --){
solve();
}
return 0;
}