import std.stdio, std.conv, std.string, std.bigint; import std.math, std.random, std.datetime; import std.array, std.range, std.algorithm, std.container; string read(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; } void main(){ long n = read.to!long; long[] bs; for(long b = 1; b < n; b *= 2, b += 1) bs ~= b; foreach_reverse(b; bs) if(n >= b) n -= b; if(n == 0) "YES".writeln; else "NO".writeln; }