N = gets.to_i
N.times do
  data = gets.split.map(&:to_f)

  a = (data[3]-data[1])/(data[2]-data[0])
  b = (data[7]-data[5])/(data[6]-data[4])
  if sprintf("%#.05g", a) ==  sprintf("%#.05g", b)
    puts "YES"
  else
    puts "NO"
  end
end