import Control.Monad (replicateM_)

type Point = (Double, Double)
type Vector = (Double, Double)

main = do
    n <- readLn
    replicateM_ n (input >>= return . solve >>= output)

input :: IO (Point,Point,Point,Point)
input = do
    line <- getLine
    let
        [x1,y1,x2,y2,x3,y3,x4,y4] = map read $ words line
    return ((x1,y1),(x2,y2),(x3,y3),(x4,y4))

output :: Bool -> IO ()
output r = putStrLn (if r then "YES" else "NO")

solve :: (Point,Point,Point,Point) -> Bool
solve (p1,p2,p3,p4) = isParallel (vector p1 p2) (vector p3 p4)

vector :: Point -> Point -> Vector
vector o p = (px-ox, py-oy)
    where
    (ox,oy) = o
    (px,py) = p

isParallel :: Vector -> Vector -> Bool
isParallel a b = ab * ab == aa * bb
    where
    aa = ax * ax + ay * ay
    bb = bx * bx + by * by
    ab = ax * bx + ay * by
    (ax,ay) = a
    (bx,by) = b