def solve(): x,y,xx,yy,X,Y,XX,YY = map(int,input().split()) P = [xx-x,yy-y] Q = [XX-X,YY-Y] if P == [0,0] and Q == [0,0]: print('Yes') return if P == [0,0]: print('No') return if P[0] == 0: P = P[::-1] Q = Q[::-1] # 向きが違う if P[0] * Q[0] <= 0: print('No') return # 平行でない if P[0] * Q[1] != P[1] * Q[0]: print('No') return # 距離の大小 if P[0]**2 + P[1]**2 > Q[0]**2 + Q[1]**2: print('Yes') return print('No') return t = int(input()) for i in range(t): solve()