#include using namespace std; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int a, b; cin >> a >> b; long long res = 1; for (int k = 0; k < 31; ++k) { int x = a >> k & 1; int y = b >> k & 1; if (x == 1 and y == 0) { res *= 0; } else if (x == 0 and y == 1) { res *= 2; } } res += a == b; res /= 2; cout << res << '\n'; }