#include using namespace std; int main() { int a, b; cin >> a >> b; int cnt = 0; for(int i = 30; i >= 0; --i) { int aa = (a >> i) & 1; int bb = (b >> i) & 1; if(aa == bb) continue; if(aa > bb) { cout << 0 << '\n'; return 0; } ++cnt; } cout << (1 << max(0, cnt - 1)) << '\n'; return 0; }