import sys sys.setrecursionlimit(5*10**5) input = sys.stdin.readline from collections import defaultdict, deque, Counter from heapq import heappop, heappush from bisect import bisect_left, bisect_right from math import gcd def sol(): x1,y1,x2,y2,X1,Y1,X2,Y2 = map(int,input().split()) dX,dY = X1-X2, Y1-Y2 dx,dy = x1-x2, y1-y2 xyg = gcd(dx,dy) XYg = gcd(dX,dY) if (dx == dX and dy == dY): print('No') elif (dx//xyg == dX//XYg and dy//xyg == dY//XYg) or (dx//xyg == -dX//XYg and dy//xyg == -dY//XYg): print('Yes') else: print('No') return T = int(input()) for i in range(T): sol()