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)
      then "YES"
      else "NO"

cross :: Double -> Double -> Double -> Double -> Bool
cross x1 y1 x2 y2 = x1*y2 == y1*x2