import Control.Monad
import Data.List

main = do
  n <- readLn
  s <- map (map (read :: (String -> Int)) . words) <$> replicateM n getLine
  mapM_ putStrLn $ map (\x -> if x then "YES" else "NO") $ map (\x -> (x !! 2) ^ 2 == (x !! 0) ^ 2 + (x !! 1) ^ 2)  $ map (sort) s