#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
struct Info {
int x, y;
};
int T, n, ans[1001][1001], dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};
bool vis[1001][1001];
queue<Info> q;
void bfs(int x, int y) {
q.push({x, y});
vis[x][y] = true;
ans[x][y] = 0;
while (q.size()) {
int t1 = q.front().x, t2 = q.front().y;
q.pop();
for (int i = 0; i < 4; i++) {
int xx = t1 + dx[i], yy = t2 + dy[i];
if (xx >= 1 && xx <= n && yy >= 1 && yy <= n && !vis[xx][yy]) {
vis[xx][yy] = true;
q.push({xx, yy});
ans[xx][yy] = ans[t1][t2] + 1;
}
}
}
}
int main() {
ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
cin >> T;
while (T--) {
memset(ans, 0x3f, sizeof ans);
ans[1][1] = 0;
cin >> n;
for (int i = 1; i <= 2 * n - 2; i++) {
int x, y;
cin >> x >> y;
vis[x][y] = true;
}
bfs(1, 1);
if (ans[n][n] == INF)
cout << "No" << endl;
else
cout << "Yes" << endl;
}
return 0;
}