import Control.Monad
import Control.Applicative
import Data.Functor
import Data.List
import Data.List.Split
import Data.Char

readInt = read :: String -> Integer
getInt = readLn :: IO Int
getInts = map readInt . words <$> getLine
gets = map read . words <$> getLine
sjoin :: (Show a) => [a] -> String
sjoin = unwords . map show
cond :: a -> a -> Bool -> a
cond t f c = if c then t else f
-- end of templete

fix x = round (x * 100000)

f [x1,y1,x2,y2,x3,y3,x4,y4] = dx1 * dy2 == dy1 * dx2
  where
    dx1 = x2 - x1
    dy1 = y2 - y1
    dx2 = x4 - x3
    dy2 = y4 - y3

main = getInt >>= flip replicateM gets >>= mapM_ (putStrLn . cond "YES" "NO" . f . map fix)