import sys #sys.setrecursionlimit((1<<19)-1) #import pypyjit #pypyjit.set_param('max_unroll_recursion=-1') input=sys.stdin.buffer.readline T=int(input()) for i in range(T): x1,y1,x2,y2,X1,Y1,X2,Y2=map(int,input().split()) if x1==X1 and y1==Y1 and x2==X2 and y2==Y2: print("Yes") elif (x1-x2)**2+(y1-y2)**2>(X1-X2)**2+(Y1-Y2)**2: print("Yes") else: print("No")