def can_match(): T = int(input()) results = [] for _ in range(T): x1, y1, x2, y2, X1, Y1, X2, Y2 = map(int, input().split()) dist1 = ((x1-X1)**2 + (y1-Y1)**2)**0.5 dist2 = ((x2-X2)**2 + (y2-Y2)**2)**0.5 if abs(dist1 - dist2) < 1e-9 and (x1-x2)*(X1-X2) + (y1-y2)*(Y1-Y2) >= 0: results.append('Yes') else: results.append('No') for result in results: print(result) can_match()