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

object Main extends App {
  for(i<-1 to readInt) {
    val Array(x1,y1,x2,y2,x3,y3,x4,y4) = readLine.split(" ") map { _.toDouble }
    val p = (x2-x1)*(y4-y3) - (x4-x3)*(y2-y1)
    if(p< 1e-10 && p > -(1e-10)) println("YES") else println("NO")
  }
}