import Control.Monad
import Control.Applicative
import Data.Functor
import Data.List
import Data.Char

readInt = readLn :: IO Int
readInts = map read . words <$> getLine :: IO [Int]

judge s = if a ^ 2 + b ^ 2 == c ^ 2 then "YES" else "NO"
  where
    [a,b,c] = sort s

main = readLn >>= flip replicateM readInts >>= mapM_ (putStrLn . judge)