N = int(input()) # 1 s = 0 t = 0 NEXTqueue = [(0,0)] # 計算待ちキュー can = False while True: if len(NEXTqueue) == 0: break s,t = NEXTqueue.pop(0) # 2 t *= 2 # 3 # 4 #s += t if s+t == N or s+t+1 == N: can = True break if (s+t,t) not in NEXTqueue: NEXTqueue.append((s+t, t)) if (s+t+1, t+1) not in NEXTqueue: NEXTqueue.append((s+t+1, t+1)) if NEXTqueue[-1][0] > N: break if can: print('YES') else: print('NO')