import Data.List

check :: [[Int]] -> [Bool]
check x
  | x == [] = []
  | ((head x) !! 0)^2 +	((head x) !! 1)^2 == ((head x) !! 2)^2 = True :	check (tail x)
  | otherwise = False :	check (tail x)

solve :: [Int] -> [String]
solve (x:y:z:xs)
  | xs == [] = []
  | or $ check $ permutations [x,y,z] = "YES"	: solve	xs
  | otherwise	= "NO" : solve xs

main = getContents >>= mapM_ putStrLn . solve . (++[-1,-1,-1]) . map read . tail . words