import sys def I(): return int(sys.stdin.readline().rstrip()) N = I() a = N//2 b = (2**29*(N+30))//(2**30-1) for i in range(a,b+1): x = 0 for _ in range(30): x += i i //= 2 if x == N: print('YES') break else: print('NO')