from math import gcd class Fraction: def __init__(self, top, bottom): self.top = top self.bottom = bottom def to_fraction(n): if type(n) == int: return Fraction(n, 1) else: return n def compare(L, R): L, R = to_fraction(L), to_fraction(R) a = L.top*R.bottom b = L.bottom*R.top if a < b: return -1 elif a == b: return 0 else: return 1 def max_f(L, R): return L if compare(L, R) == 1 else R def min_f(L, R): return L if compare(L, R) == -1 else R def ADD(L, R): L, R = to_fraction(L), to_fraction(R) l, r = L.bottom, R.bottom lt = L.top*r rt = R.top*l top = lt+rt bottom = l*r GCD = gcd(top, bottom) top //= GCD bottom //= GCD return Fraction(top, bottom) def SUB(L, R): L, R = to_fraction(L), to_fraction(R) l, r = L.bottom, R.bottom lt = L.top*r rt = R.top*l top = lt-rt bottom = l*r GCD = gcd(top, bottom) top //= GCD bottom //= GCD return Fraction(top, bottom) def MUL(L, R): L, R = to_fraction(L), to_fraction(R) top = L.top*R.top bottom = L.bottom*R.bottom GCD = gcd(top, bottom) top //= GCD bottom //= GCD return Fraction(top, bottom) def DIV(L, R): L, R = to_fraction(L), to_fraction(R) top = L.top*R.bottom bottom = L.bottom*R.top GCD = gcd(top, bottom) top //= GCD bottom //= GCD return Fraction(top, bottom) def decimal(F): return F.top/F.bottom for _ in range(int(input())): ax, ay, bx, by, cx, cy = map(int, input().split()) if bx == 0: ax, ay, bx, by = bx, by, ax, ay if ax == 0: if bx == 0: if cx < 0 and cy == 0: print("Yes") else: print("No") elif 1 <= bx: a, b = -by, bx if (a, b) == (cx, cy): print("Yes") else: print("No") else: print("No") elif cx == 0: if compare(MUL(Fraction(ay, ax), Fraction(by, bx)), 1) == 0: print("Yes") else: print("No") elif cy == 0: if 1 <= cx: if ay == by == 0: print("Yes") else: print("No") else: print("No") else: if compare(ADD(Fraction(ay, ax), Fraction(by, bx)), SUB(Fraction(cy, cx), MUL(MUL(Fraction(ay, ax), Fraction(by, bx)), Fraction(cy, cx)))) == 0: print("Yes") else: print("No")