for _ in range(int(input())): x1, y1, x2, y2, X1, Y1, X2, Y2 = map(int, input().split()) dx1, dy1 = x1 - x2, y1 - y2 dX1, dY1 = X1 - X2, Y1 - Y2 ans = dx1 * dY1 - dy1 * dX1 == 0 and dx1 ** 2 + dy1 ** 2 > dX1 ** 2 + dY1 ** 2 print('Yes' if ans else 'No')