main :: IO () main = do n <- (* 2) <$> (readLn :: IO Int) let k = round . sqrt . fromIntegral $ n if n == k * (k + 1) then do putStrLn "YES" print k else putStrLn "NO"