solve :: [Float] -> String
solve [a,b,c,d,e,f,g,h] 
  | (d-b)/(c-a) == (h-f)/(g-e) = "YES"
  | otherwise = "NO"
 
main = getContents >>= mapM_ putStrLn . map solve . tail . map (map read . words) . lines