require "matrix"

def vectorLength(vector)
   Math.sqrt(vector[0] ** 2 + vector[1] ** 2)
end

def unitVector(vector)
   vector / vectorLength(vector)
end

#main
n = gets.to_i
arr = Array.new
n.times{arr << gets}
arr.each do |i|
   k = i.split(" ")
   k.map!{|j| j.to_f}
   a = Vector[k[0], k[1]]
   b = Vector[k[2], k[3]]
   ab = b - a
   c = Vector[k[4], k[5]]
   d = Vector[k[6], k[7]]
   cd = d - c
   ab_u = unitVector(ab)
   cd_u = unitVector(cd)
   puts (ab_u == cd_u or ab_u == -1 * cd_u) ? "YES" : "NO"
end