#include #include #include #include using namespace std; using ll = long long; int main(void){ int a, b; cin >> a >> b; if((a&b)!=a){ cout << 0 << endl; return 0; } int k=__builtin_popcount(a); int m=__builtin_popcount(a^b); if(m) cout << (1<<(m-1)) << endl; else cout << 1 << endl; return 0; }