delta = 1e-11
while input = gets
  n = input.chomp.to_i
  n.times do
    isParallel = false
    x1, y1, x2, y2, x3, y3, x4, y4 = gets.chomp.split(" ").map(&:to_f) 
    if x1 != x2
      if x3 != x4  
        d = ((y1-y2)/(x1-x2) - (y3-y4)/(x3-x4)).abs
        isParallel = true if d < delta 
      end
    else x1 == x2
      isParallel = true if x3 == x4
    end
    puts isParallel ? "YES" : "NO"
  end
end

