/** * @FileName a.cpp * @Author kanpurin * @Created 2022.05.28 00:59:29 **/ #include "bits/stdc++.h" using namespace std; typedef long long ll; int main() { int a,b;cin >> a >> b; int _a = a; int _b = b; int c = 0; while(_a > 1 && _b > 1) { c++; _a /= 2; _b /= 2; } if (_a==_b && _b == 1) { cout << (1<