popcnt=lambda x:bin(x).count("1") n=int(input()) for x in range(1,100000): if x==popcnt(n+x): print("YES") exit() print("NO")