#include <queue>
#include <memory.h>
#include <iostream>
#include <algorithm>
#define L unsigned long long
#define LL long long
#define I unsigned int
#define endl '\n'
#define soun(nf, nl, m) \
sort(nf, nl); \
m = unique(nf, nl) - (nf)
#define ref(i, a, b, p) for (signed(i) = (a); (i) <= signed(b); (i) += signed(p))
#define gef(i, a, b, p) for (signed(i) = (a); (i) >= signed(b); (i) -= signed(p))
using namespace std;
bool map[2005][2005];
int T, n;
struct node
{
int x, y;
};
queue<node> st, q;
int wx[4] = {1, -1, 0, 0};
int wy[4] = {0, 0, 1, -1};
void bfs()
{
bool flag = 0;
q.push(node{1, 1});
while (!q.empty())
{
node nw = q.front();
q.pop();
int x = nw.x, y = nw.y;
map[x][y] = 1;
ref(i, 0, 3, 1)
{
int nwx = x + wx[i], nwy = y + wy[i];
if (nwx > n || nwx < 1 || nwy > n || nwy < 1 || map[nwx][nwy] == 1)
continue;
if (nwx == n && nwy == n)
{
flag = 1;
break;
}
else
q.push(node{nwx, nwy});
}
node nw1 = st.front();
int x1 = x = nw1.x, y1 = nw1.y;
map[x1][y1] = 1;
st.pop();
q.pop();
}
if (flag)
cout << "Yes" << endl;
else
cout << "No" << endl;
return;
}
void work()
{
ios::sync_with_stdio(false);
cin.tie(0);
cin >> T;
ref(i, 1, T, 1)
{
while (!st.empty())
st.pop();
while (!q.empty())
q.pop();
cin >> n;
ref(j, 1, 2 * n - 2, 1)
{
int x, y;
cin >> x >> y;
st.push(node{x, y});
}
bfs();
}
return;
}
int main()
{
work();
return 0;
}