N = int(input()) d = 21 ls = set() def dfs(t,s,dep): if dep == d: ls.add(s) return ls.add(s) dfs(2*t, s+2*t, dep+1) dfs(2*t+1, s+2*t+1, dep+1) dfs(0,0,0) ls = list(ls) ls.sort() if N in ls: print('YES') else: if ls[-1] < N: print('YES') else: print('NO')