T = int(input()) def solve(x1,y1,x2,y2,X1,Y1,X2,Y2): if (x1,y1)==(X1,Y1) and (x2,y2)==(X2,Y2):return True # 平行ならNo dx1 = X1-x1 dx2 = X2-x2 dy1 = Y1-y1 dy2 = Y2-y2 if dx1*dy2 - dx2*dy1 == 0: return False return (x2-x1)*(dx1-dx2) >= 0 and (y2-y1)*(dy1-dy2) >= 0 and (x2-x1)*(dy1-dy2) == (y2-y1)*(dx1-dx2) for _ in range(T): x1,y1,x2,y2,X1,Y1,X2,Y2 = map(int,input().split()) print("Yes" if solve(x1,y1,x2,y2,X1,Y1,X2,Y2) else "No")