#define _USE_MATH_DEFINES #include using namespace std; signed main() { ios::sync_with_stdio(false); cin.tie(0); long long a, b; cin >> a >> b; int cnt = 0; for (int i = 0; i < 33; i++) { cerr << ((a >> i) & 1) << " " << ((b >> i) & 1) << endl; if ((a & (1LL << i)) == 0 && (b & (1LL << i))) cnt++; if (((a >> i) & 1) == 1 && (b & (1LL << i)) == 0) { cout << 0 << '\n'; return 0; } } cout << (cnt > 0 ? (long long) pow(2, cnt) / 2 : 1) << '\n'; return 0; }