t = int(input()) for _ in range(t): a,b,c,d,e,f = map(int,input().split()) if ((f*a < e*b) or (f*c < e*d)) and e > 0 and f > 0: #角度が角 A < C < B かつ cos(C-A) = cosB になるケースを排除 print("No") continue # あとはA,Bをスワップ死ながら cos(C-A) = cosB になればYes,それ以外No if a*a*(c*c+d*d)*(e*e+f*f) == (c*e+d*f)*(c*e+d*f)*(a*a+b*b): print("Yes") else: a,b,c,d = c,d,a,b if a*a*(c*c+d*d)*(e*e+f*f) == (c*e+d*f)*(c*e+d*f)*(a*a+b*b): print("Yes") else: print("No")