I,R,O=input,range,print J=lambda:map(int,I().split()) def G(a,b,c,d): return a*d-b*c!=0 for t in R(int(I())): x,y,z,w,X,Y,Z,W=J() O("YNeos"[G(x-z,y-w,X-Z,Y-W)or abs(x-z)<=abs(X-Z)::2])