object Main extends App {
  val n = readInt()
  (1 to n).foreach { i =>
    val arr = readLine().split(" ").map(_.toDouble)
    val (x1, y1) = (arr(0), arr(1))
    val (x2, y2) = (arr(2), arr(3))
    val (x3, y3) = (arr(4), arr(5))
    val (x4, y4) = (arr(6), arr(7))
    if (Math.abs((y2 - y1) * (x4 - x3) - (y4 - y3) * (x2 - x1)) < 1e-7) println("YES") else println("NO")
  }
}