N = int(input()) for i in range(35, 0, -1): if N >= 2 ** i - 1: N -= 2 ** i - 1 print("NO") if N else print("YES")