import Control.Applicative
import Control.Monad

solve = do
  input <- fmap (read :: String -> Double) . words <$> getLine
  isParallel input

isParallel (x1:y1:x2:y2:x3:y3:x4:y4:y4s) = do
  if x1 == x2 || x3 == x4
    then if (x1 - x2) == (x3 - x4)
            then putStrLn "YES"
            else putStrLn "NO"
    else let s = (y1 - y2) / (x1 - x2) - (y3 - y4) / (x3 - x4)
         in if ((abs s) < 0.0000001)
            then putStrLn "YES"
            else putStrLn "NO"

main = do
  n <- readLn
  replicateM n solve