#include using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { cin.tie(nullptr)->sync_with_stdio(false); ll a, b; cin >> a >> b; int ans = 1; bool flg = false; rep(i, 60) { int x = (a >> i) & 1; int y = (b >> i) & 1; if (x == 0 && y == 0) ans *= 1; if (x == 0 && y == 1) ans *= flg ? 2 : 1, flg = true; if (x == 1 && y == 0) ans *= 0; if (x == 1 && y == 1) ans *= 1; } cout << ans << '\n'; return 0; }