import Control.Applicative
import Control.Monad (replicateM)

data YesNo = YES | NO deriving(Show)
type Coord = (Double, Double)

reshape :: [Double] -> [Coord]
reshape [] = []
reshape [_] = []
reshape (x:y:xs) = (x, y) : reshape xs

grad :: Coord -> Coord -> Double
grad (x1, y1) (x2, y2) =
  if x2 - x1 == 0
    then 0.0
  else
    (y2 - y1) / (x2 - x1)

isParallel :: [Coord] -> YesNo
isParallel [] = NO
isParallel [_] = NO
isParallel [_, _] = NO
isParallel [_, _, _] = NO
isParallel (a:b:c:d:_) =
  let ab = a `grad` b
      cd = c `grad` d
  in
      if ab == cd
        then YES
      else
        NO

solver :: [[Double]] -> [YesNo]
solver = map (isParallel . reshape)

main :: IO()
main = do
  n <- (read :: String -> Int) <$> getLine
  coords <- map (map (read :: String -> Double) . words) <$> replicateM n getLine
  mapM_ print $ solver coords