n=int(input()) for j in range(n): s=int(input()) x=[] y=[] for i in range(s): a,b=map(int,input().split()) x.append(abs(a)) y.append(abs(b)) p=max(x) q=max(y) ws=10 for i in range(0,s): if(x[i]==0 or y[i]==0): continue elif((x[i]==p and y[i]<=q)) : continue elif(x[i]<=p and y[i]==q): continue else: ws=0 break if(ws==0): print("NO") else: print("YES")