import scala.io.StdIn.{readLine,readInt}

object Main extends App {
  for(i<-1 to readInt) {
    val x = readLine.split(" ") map { _.toDouble }
    val p = (x(2)-x(0))*(x(7)-x(5)) - (x(6)-x(4))*(x(3)-x(1))
    if(p< 1e-10 && p > -(1e-10)) println("YES") else println("NO")
  }
}