import Data.List

main = do
  _ <- getLine
  s' <- getContents
  let s =  map (sortBy (compare)) $ map (map read)  $ map words $ lines s'
  mapM putStrLn (map yesOrno s)

yesOrno [a,b,c]
  | a^2 + b^2 == c^2 = "YES"
  | otherwise    = "NO"