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 (x1,y1) == (X1,Y1) and (x2,y2) == (X2,Y2): print('Yes') elif x1 == X1 == x2 == X2: if y1 <= Y1 < Y2 <= y2: print('Yes') elif y1 >= Y1 > Y2 >= y2: print('Yes') else: print('No') elif y1 == Y1 == y2 == Y2: if x1 <= X1 < X2 <= x2: print('Yes') elif x1 >= X1 > X2 >= x2: print('Yes') else: print('No') elif (dx//xyg == dX//XYg and dy//xyg == dY//XYg) and abs(dx) > abs(dX): print('Yes') else: print('No') return T = int(input()) for i in range(T): sol()