import Control.Monad

main = do
    n <- readLn
    ls <- replicateM n getLine
    mapM_ putStrLn (solve ls)

--solve :: [String] -> String
solve = map(solve_ . map (\x -> read x :: Int) . words)

solve_ :: [Int] -> String
solve_ x =
    let m1 = (maximum x) ^2 *2; m2 = sum $ map (^2) x
    in if (m1 == m2) then "YES" else "NO"