#include #include #include #include #include using namespace std; typedef long long int ll; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); ll a,b; cin >> a >> b; ll k=(a|b); if(k!=b||a>b){ cout << 0 << endl; return 0; } int n=__builtin_popcountll(b)-__builtin_popcountll(a); cout << (ll)pow(2,n)/2 << endl; }