#include <iostream>
using namespace std;

int main() {
    int x, y;
    while (cin >> x >> y) {
        bool flag = false;
        if (x > y) swap(x, y); //x<=y
        for (int i = 0; i <= 15; i++) {
            if (x == y) {
                flag = true;
                cout << "YES" << endl;
                break;
            } else {
                if ((x >> 15) & 1) { //如果最高位是1
                    x = (x << 1)&0xffff;
                    x += 1; //最高位的1补到最后
                } else {
                    x = (x << 1)&0xffff;
                }
            }
        }
        if (!flag) cout << "NO" << endl;
    }
    return 0;
}
// 64 位输出请用 printf("%lld")