main = do n <- readLn putStrLn $ if elem 0 $ scanl (-) n $ reverse $ takeWhile (<= n) $ scanl1 (+) $ map (2^) [0..] then "YES" else "NO"