#include using namespace std; int main() { int a, b; cin >> a >> b; int cnt = 0; for (int i=0;i<31;++i) { int x, y; x = (a>>i)&1; y = (b>>i)&1; if (x == y) continue; else if (x == 0 and y == 1) ++cnt; else { cout << 0 << endl; return 0; } } if (cnt == 0) { cout << 1 << endl; return 0; } int ans = 1; --cnt; while (cnt--) ans *= 2; cout << ans << endl; return 0; }