n = input()+1
for v in range(1,n):
        (x1,y1,x2,y2,x3,y3,x4,y4)=map(int,raw_input().split())
        if x2-x1=0 or x4-x3=0:
                if x2-x1=0 and x4-x3=0:
                        print "YES"
                else:
                        print "NO"
        elif y2-y1=0 or y4-y3=0:
                if y2-y1=0 and y4-y3=0:
                        print "YES"
                else:
                        print "NO"
        else:
                a = (y2-y1)/(x2-x1)