from queue import Queue N = int(input()) def bfs(): step = 0 s = 0 t = 0 que = Queue() que.put((step,s,t)) while not que.empty(): step,s,t = que.get() step = step % 2 if step == 0: que.put((step+1,s,2*t)) elif step == 1: if s+t+1 == N or s+t == N: print('YES') exit(0) elif N < s+t+1 or N < s+t: print('NO') exit(0) else: que.put((step+1,s+t+1,t+1)) que.put((step+1,s+t,t)) print('NO') bfs()