#include<bits/stdc++.h>
#define PII pair<int,int>
using namespace std;
const int N=1e3+10;
int k,n,x[N],y[N],t;
int dx[4]={1,-1,0,0},dy[4]={0,0,1,-1};
bool vis[N][N];
struct node{
int x;
int y;
int t;
};
void solve()
{
queue<node>q;
q.push({1,1,0});
memset(vis,false,sizeof(vis));
vis[1][1]=true;
t=0;
while(!q.empty())
{
node tmp=q.front();
q.pop();
int xx,yy,tt;
tt=tmp.t;
xx=tmp.x;
yy=tmp.y;
if(xx==n && yy==n)
{
cout << "Yes" << endl;
return;
}
if(tt!=t && t<=2*n-2)
{
vis[x[t]][y[t]]=true;
t=tt;
}
for(int i=0;i<4;i++)
{
int tmpx,tmpy,tmpt;
tmpx=xx+dx[i];
tmpy=yy+dy[i];
tmpt=tt+1;
if(!vis[tmpx][tmpy] && tmpx>0 && tmpy>0 && tmpx<=n && tmpy<=n)
{
vis[tmpx][tmpy]=true;
q.push({tmpx,tmpy,tmpt});
}
}
}
cout << "No" << endl;
return;
}
int main()
{
cin >> k;
while(k--)
{
cin >> n;
for(int i=1;i<=2*n-2;i++) cin >> x[i] >> y[i];
solve();
}
return 0;
}