#include #include #include using namespace std; int msb(long long n) { for (int i = 60; i >= 0; i--) { if (n >> i & 1) return i; } return -1; } bool f(long long a, long long b) { int c = 0; long long y = 0; for (int i = msb(a) - 1; i >= 0; i--) { y++; if (a >> i & 1) { y *= 2; } } return y == b; } int main() { long long a, b; cin >> a >> b; if (f(a, b) || f(b, a)) { cout << "Yes" << endl; } else { cout << "No" << endl; } }