def gcd(a,b): while b!=0: r=a%b a,b=b,r return abs(a) T=int(input()) for _ in range(T): x1,y1,x2,y2,X1,Y1,X2,Y2=list(map(int,input().split())) diff_x1=x1-X1 diff_y1=y1-Y1 diff_x2=x2-X2 diff_y2=y2-Y2 g1=gcd(diff_x1,diff_y1) g2=gcd(diff_x2,diff_y2) diff_x1//=g1 diff_y1//=g1 diff_x2//=g2 diff_y2//=g2 if diff_x1<0: diff_x1*=-1 diff_y1*=-1 if diff_x2<0: diff_x2*=-1 diff_y2*=-1 if diff_x1==-diff_x2 and diff_y1==diff_y2:print("Yes") elif diff_x1==diff_x2 and diff_y1==-diff_y2:print("Yes") else:print("No")