T=int(input()) def dist(a,b): return (a[0]-b[0])**2+(a[1]-b[1])**2 def gcd(a,b): while b!=0: r=a%b a,b=b,r return abs(a) def inc(a,b): diff_x=a[0]-b[0] diff_y=a[1]-b[1] g=gcd(diff_x,diff_y) diff_x//=g diff_y//=g return (diff_x,diff_y) for _ in range(T): x1,y1,x2,y2,X1,Y1,X2,Y2=map(int,input().split()) P1=[x1,y1] P2=[x2,y2] Q1=[X1,Y1] Q2=[X2,Y2] if P1==Q1 and P2==Q2: print("Yes") continue if dist(P1,P2)<=dist(Q1,Q2): print("No") continue if inc(P1,P2)==inc(Q1,Q2):print("Yes") else:print("No")