#include "bits/stdc++.h" #define rep(i,n) for(int i=0;i> A >> B; ll ans = 1; rep(i, 30) { int c = A % 2, d = B % 2; if (c == 1 && d == 0) { cout << 0 << endl; return 0; } if (c == 0 && d == 1) ans *= 2; A /= 2; B /= 2; } cout << ans / 2 << endl; }