N = int(input()) t = 1 sum_t = t t_list = [] while sum_t<=N: t_list.append(sum_t) t *= 2 sum_t += t s = 0 t_list.reverse() for i in t_list: if s+i <= N: s += i if s==N: print("YES") exit(0) print("YES" if N==0 else "NO")