X = gets.to_i if X == 0 puts "Yes" exit end MAX = 2 * 10**18 (0..62).each do |m| n = X ^ m if n <= MAX and n.to_s(2).count(?1) == m puts n exit end end puts -1