import sys, time, random from collections import deque, Counter, defaultdict input = lambda: sys.stdin.readline().rstrip() ii = lambda: int(input()) mi = lambda: map(int, input().split()) li = lambda: list(mi()) inf = 2 ** 61 - 1 mod = 998244353 def solve(): x1, y1, x2, y2, X1, Y1, X2, Y2 = mi() if (x1 == X1) and (y1 == Y1) and (x2 == X2) and (y2 == Y2): print('Yes') return elif (x1 - x2) * (Y1 - Y2) != (X1 - X2) * (y1 - y2): print('No') return elif (x2 - x1) ** 2 + (y2 - y1) ** 2 <= (X1 - X2) ** 2 + (Y2 - Y1) ** 2: print('No') return else: print('Yes') for _ in range(ii()): solve()