#include #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(0); // N xor popcnt(N) = X ll X; cin >> X; if(X == 0LL){ cout << "Yes" << endl; return 0; } for(ll pcnt = 0; pcnt <= 60; pcnt++) { ll N = X ^ pcnt; if(__builtin_popcountl(N) == pcnt) { cout << N << endl; return 0; } } cout << -1 << endl; return 0; }