J=lambda:map(int,input().split()) for q in range(sum(J())):I,*_=J();A,B,X,Y=J();C,D,Z,W=J();E,F=C*X+D*Y-I,A*Z+B*W-I;print("YNeos"[I!=A*X+B*Y or I!=C*Z+D*W or(E>0)-(E<0)+(F>0)-(F<0)<0::2])