import sys input = sys.stdin.readline from math import gcd def frac(x, y): if x == 0: return (0, 2 * int(y > 0) - 1) if y == 0: return (2 * int(x > 0) - 1, 0) g = gcd(x, y) x, y = x // g, y // g return (x, y) T = int(input()) for _ in range(T): x1, y1, x2, y2, X1, Y1, X2, Y2 = map(int, input().split()) dx1 = X1 - x1 dx2 = X2 - x2 dy1 = Y1 - y1 dy2 = Y2 - y2 if (x1, x2, y1, y2) == (X1, X2, Y1, Y2): print("Yes") elif frac(x2 - x1, y2 - y1) != frac(X2 - X1, Y2 - Y1): print("No") elif (x2 - x1) ** 2 + (y2 - y1) ** 2 <= (X2 - X1) ** 2 + (Y2 - Y1) ** 2: print("No") else: print("Yes")