T = int(input()) for i in range(T): x1, y1, x2, y2, X1, Y1, X2, Y2 = map(int, input().split()) P1 = complex(x1, y1) P2 = complex(x2, y2) Q1 = complex(X1, Y1) Q2 = complex(X2, Y2) A = P1-P2 B = Q1-Q2 k = 1 - (B/A) if k.imag == 0 and 0 < k.real < 1: if Q1 - (B/A) * P1 == Q2 - (B/A) * P2: print("Yes") else: print("No")