object Main extends App {
  val n = readLine.toInt

  for (i <- 0 until n) {
    val Seq(x1, y1, x2, y2, x3, y3, x4, y4) = readLine.split(' ').map(_.toDouble).toList
    val vabx = x2 - x1
    val vaby = y2 - y1
    val vcdx = x4 - x3
    val vcdy = y4 - y3

    val det = vabx * vcdy - vcdx * vaby

    println(if (det.abs > 1e-10) "NO" else "YES")
  }
}
