import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ Scanner input = new Scanner(System.in); int q = input.nextInt(); for (int i = 0; i < q; i++) { boolean isYes = true; int n = input.nextInt(); int x1, x2, y1, y2; x1 = input.nextInt(); y1 = input.nextInt(); x2 = input.nextInt(); y2 = input.nextInt(); for (int j = 2; j < n; j++) { int x = input.nextInt(); if (x != x1 && x != x2) { isYes = false; break; } int y = input.nextInt(); if (y != y1 && y != y2) { isYes = false; break; } } if (!isYes) { System.out.println("YES"); } else { System.out.println("NO"); } } } }