#include using namespace std; typedef long long ll; typedef pair P; typedef pair, int> PP; const ll INF = 1LL << 60; const ll MOD = 1000000007; int GCD(int a, int b) { return b ? GCD(b, a%b) : a; } //------------------------------------------------------------------------------------------------------------------------------ int main(void) { ll A, B; int ans = 1; cin >> A >> B; bool flag = false; for (int i = 60; i >= 0; i--) { ll d = 1LL << i; if ((A & d) && !(B & d)) { ans = 0; } else if(!(A & d) && (B & d)){ if (!flag) flag = true; else ans *= 2; } } cout << ans << endl; }