import Data.Ratio
main = getContents >>= mapM_ (putStrLn . parallelism . map (read::String->Float) . words) . tail . lines
parallelism [x1,y1,x2,y2,x3,y3,x4,y4]
 | (x1==x2) && (x3==x4) = "YES"
 | (x1==x2) || (x3==x4) = "NO"
 | otherwise = if dab == dcd then "YES" else "NO"
  where
   dab = approxRational ((y2-y1)/(x2-x1)) 1e-6
   dcd = approxRational ((y4-y3)/(x4-x3)) 1e-6