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