import Control.Monad

data YesNo = YES | NO deriving(Show)

isYes :: Bool -> YesNo
isYes boo
  | boo = YES
  | not boo = NO
  | otherwise    = NO

solver :: [Int] -> YesNo
solver (x:y:z:_) =
  let x1 = (x * x + y * y == z * z)
      x2 = (y * y + z * z == x * x)
      x3 = (z * z + x * x == y * y)
  in
      isYes $ x1 || x2 || x3
solver _ = NO

seqRead :: [String] -> [Int]
seqRead xs = map read xs :: [Int]


main :: IO()
main = do
  num <- getLine
  let n = read num :: Int
  line <- replicateM n getLine
  let line' = map words line :: [[String]]
      line'' = map seqRead line'
  mapM_ (print . solver) line''