def say(s);puts s;exit 0;end n = gets.to_i z = 1 << 31 while z > 0 n -= z-1 if z-1 <= n say "YES" if n == 0 z >>= 1 end say "NO"