#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 x = 1; long long y = 0; long long z = 2; for (int i = msb(a) - 1; i >= 0; i--) { x *= 2; y++; if (a >> i & 1) { y *= 2; z *= 2; x++; } } return (b - y) % z == 0; } int main() { long long a, b; cin >> a >> b; if (a == 0 || b == 0 || f(a, b) || f(b, a)) { cout << "Yes" << endl; } else { cout << "No" << endl; } }