import Control.Monad
import Control.Applicative

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

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

sub :: Coord -> Coord -> Coord
sub (x1, y1) (x2, y2) = (x2 - x1, y2 - y1)

judge :: Coord -> Coord -> Bool
judge (x1, y1) (x2, y2) = (x1 * y2) - (x2 * y1) < 1.0e-7

isParallel :: [Coord] -> YesNo
isParallel [] = NO
isParallel [_] = NO
isParallel [_, _] = NO
isParallel [_, _, _] = NO
isParallel (a:b:c:d:_) =
  let ab = a `sub` b
      cd = c `sub` d
  in
      if judge 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