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]

cond t f c = if c then t else f

judge s = a ^ 2 + b ^ 2 == c ^ 2
  where
    [a,b,c] = sort s

main = readLn >>= flip replicateM readInts >>= mapM_ (putStrLn . cond "YES" "NO" . judge)