import Control.Applicative
import Control.Monad

main = do
    n <- readLn
    dataSet <- replicateM n (map read.words<$>getLine)
    let res = map (\[x1,y1,x2,y2,x3,y3,x4,y4] -> isParallel (x2-x1) (y2-y1) (x4-x3) (y4-y3)) dataSet
    mapM_ yesOrNo res

yesOrNo a = if a then putStrLn "YES"
                 else putStrLn "NO"

isParallel :: Double -> Double -> Double -> Double -> Bool
isParallel x1 y1 x2 y2 = x1*y2 - y1*x2 == 0

