module Vector =
  struct
    type t = { x: float; y:float }
    let eps = 1e-10
    let set x y = {x = x; y = y}
    let add v1 v2 = {x = v1.x +. v2.x; y = v1.y +. v2.y}
    let sub v1 v2 = {x = v1.x -. v2.x; y = v1.y -. v2.y}
    let mul v a = {x = v.x *. a; y = v.y *. a}
    let div v a = {x = v.x /. a; y = v.y /. a}
    let norm v = v.x *. v.x +. v.y *. v.y
    let abs v = sqrt (norm v)
    let dot v1 v2 = v1.x *. v2.x +. v1.y *. v2.y
    let cross v1 v2 = v1.x *. v2.y -. v1.y *. v2.x
  end

let fabs a = if a > 0.0 then a else a *. (-1.0)

let _ =
  let is_parallel v1 v2 = fabs (Vector.cross v1 v2) < Vector.eps in
  let n = Scanf.scanf "%d\n" (fun x -> x) in
  for i = 1 to n do
    let v1, v2 = Scanf.scanf "%f %f %f %f %f %f %f %f\n" (fun x1 y1 x2 y2 x3 y3 x4 y4 -> (Vector.sub (Vector.set x2 y2) (Vector.set x1 y1), Vector.sub (Vector.set x4 y4) (Vector.set x3 y3))) in
    print_endline @@ if is_parallel v1 v2 then "YES" else "NO"
  done