Q=int(input()) for _ in range(Q): x1,y1,x2,y2,X1,Y1,X2,Y2=map(int,input().split()) if (x1==X1 and y1==Y1) or (x2==X2 and y2==Y2): print('Yes') continue a,b=x2-x1,y2-y1 c,d=X2-X1,Y2-Y1 if b*c!=a*d: print('No') continue if a**2+b**2>c**2+d**2: print('Yes') else: print('No')