#include using namespace std; int main() { int A, B; cin >> A >> B; int ans = 1; for (int i = 0; i <= 30; i++) { int a = (A >> i) & 1, b = (B >> i) & 1; if (a > b) ans = 0; else if (a == 0 && b == 1) ans *= 2; } cout << (ans == 1 ? 1 : ans/2) << endl; }