import Control.Applicative ((<$>)) main :: IO () main = do solve <$> readLn >>= mapM_ putStrLn solve :: Int -> [String] solve n | i * (i + 1) `div` 2 == n = ["YES", show i] | otherwise = ["NO"] where i = floor . sqrt . fromIntegral $ n * 2