import Control.Applicative
import Control.Monad

data Point = P {x :: Double, y :: Double}
data Line = Vert | Slope Double deriving Eq
point x y = P x y
line :: Point -> Point -> Line
line a b
  | isSame (x a) (x b) = Vert
  | otherwise = Slope $ (y b - y a)/(x b - x a)

slope (Slope a) = a

isSame :: (Fractional a, Ord a) => a -> a -> Bool
isSame a b = a - b <= 0.000001

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

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

isParallel :: Line -> Line -> Bool
isParallel p1 p2
  | p1 == Vert && p2 == Vert = True
  | p1 == Vert || p2 == Vert = False
  | otherwise = isSame (slope p1) (slope p2)

