n = int(input()) x = 1 while x < n: x = 2 * x + 1 while x > 0: if n >= x: n -= x x >>= 1 if n == 0: print("YES") else: print("NO")