def say(s);puts s;exit 0;end n = gets.to_i say "YES" if n == 1 last = nil while n > 1 l = n.bit_length #p [n,(1 << l)-1] x = (1 << l)-1 say "YES" if x == n && last != l n -= (1 << (l-1))-1 last = l-1 end say "NO"