t = int(input()) for i in range(t): x = [int(x) for x in input().split()] a = (x[0]-x[2])**2 + (x[1]-x[3])**2 b = (x[4]-x[6])**2 + (x[5]-x[7])**2 if a == b: if x[:4] == x[5:]: print("Yes") else: print("No") elif a > b: print("Yes") else: print("No")