import Control.Monad

data Point = P {x :: Double, y :: Double}

data Grad = Vert | Grad {g :: Double} deriving Eq
point x y = P x y

main = do
    n <- readLn
    dataSet <- replicateM n (fmap (map read.words) getLine)
    let res = map (apply isParallel.dataToPoint) dataSet
    mapM_ yesOrNo res

dataToPoint [x1,y1,x2,y2,x3,y3,x4,y4] = [(point x1 y1,point x2 y2),(point x3 y3,point x4 y4)]
apply f [a,b] = f a b
yesOrNo a = if a then putStrLn "YES"
                 else putStrLn "NO"

isParallel :: (Point,Point) -> (Point,Point) -> Bool
isParallel p1 p2
  | grad p1 == Vert = grad p2 == Vert
  | grad p2 == Vert = False
  | otherwise       = (g.grad $ p1) - (g.grad $ p2) <= 0.00001

grad :: (Point,Point) -> Grad
grad (p1, p2)
  | x p1 - x p2 == 0 = Vert
  | otherwise = Grad $ (y p1 - y p2) / (x p1 - x p2)