#include<bits/stdc++.h>
using namespace std;
int n,t,lx[2000],ly[2000],vis[2000][2000],flag=0,m[2000][2000],xx[4]={0,0,1,-1},yy[4]={1,-1,0,0};
struct node
{
int x,y,z;
};
void bfs(int x,int y,int t)
{
queue<node> q;
node now;
now.x=x,now.y=y,now.z=t;
q.push(now);
while(!q.empty())
{
vis[x][y]=1;
now=q.front();
q.pop();
int a=now.x,b=now.y,c=now.z;
if(a==n&&b==n)
{
flag=1;
break;
}
m[lx[c]][ly[c]]=1;
for(int k=0;k<4;k++)
{
int dx=a+xx[k],dy=b+yy[k];
if(dx>=1&&dx<=n&&dy>=1&&dy<=n)
{
if(m[dx][dy]==0&&vis[dx][dy]==0)
{
q.push({dx,dy,c+1});
}
}
}
}
return;
}
int main()
{
cin>>t;
for(int i=1;i<=t;i++)
{
flag=0;
memset(vis,0,sizeof(vis));
memset(m,0,sizeof(m));
cin>>n;
for(int j=1;j<=n;j++)
{
cin>>lx[j]>>ly[j];
bfs(1,1,0);
if(flag==1)
{
cout<<"Yes";
}
else
{
cout<<"No";
}
cout<<endl;
}
}
return 0;
}