import math t=int(input()) for _ in range(t): a1,b1,a2,b2,x1,y1,x2,y2=map(int, input().split()) if a1==x1 and b1==y1 and a2==x2 and b2==y2: print('Yes') continue deg1=math.atan2(b2-b1, a2-a1) deg2=math.atan2(y2-y1, x2-x1) dis1=((b2-b1)**2+(a2-a1)**2) dis2=((y2-y1)**2+(x2-x1)**2) #print(deg1, deg2) if dis1>dis2 and deg1==deg2: print('Yes') else: print('No')