require 'scanf'

EPS = 0.00001**2.0

def eq(a, b)
    (a-b).abs < EPS
end

n_lines = STDIN.gets.to_i
for i in 0..n_lines-1
    str = STDIN.gets
    x1,y1,x2,y2,x3,y3,x4,y4=\
        str.scanf("%f %f %f %f %f %f %f %f") 
    a, b = [x2-x1,y2-y1], [x4-x3,y4-y3]
    op = a[0]*b[1]-a[1]*b[0]
    print(if eq(op,0.0); "YES\n" else "NO\n" end)
end