# Enter your code here. Read input from STDIN. Print output to STDOUT t=int(input()) for i in range(t): n=int(input()) x=[] x=[] for j in range(n): x.append(list(map(int,raw_input().split()))) if i==0: print "YES" else: print "NO"