import Control.Applicative
import Control.Monad
import Data.List

main :: IO ()
main = do
  n <- (read :: String -> Int) <$> getLine
  sides <- replicateM n getLine
  let lns = map words sides
      ordered_sides = sort . map (read :: String -> Int) <$> lns
  mapM_ putStrLn $ map (\(x:y:z:[]) -> if x^2 + y^2 == z^2 then "YES" else "NO") ordered_sides

