import Control.Applicative
import Control.Monad

main :: IO ()
main = do
  n <- readLn
  ls <- replicateM n $ map read . words <$> getLine
  forM_ ls $ \(x1:y1:x2:y2:x3:y3:x4:y4:_) -> do
    putStrLn $ if cross (x2-x1) (y2-y1) (x4-x3) (y4-y3) == 0
      then "YES"
      else "NO"

cross :: Double -> Double -> Double -> Double -> Double
cross x1 y1 x2 y2 = abs $ x1*y2-y1*x2