位运算直接搞
#include<iostream>
using namespace std;
int change(int x , int k)
{
unsigned short y = x , z = x;
unsigned short w = ((y << k) | (z >> (16 - k)));
return w;
}
int main()
{
unsigned short a , b;
// cin >> a;
// cout << change(a , 2);
while(cin >> a >> b)
{
bool f = false;
for(int i = 0;i <= 16;i ++)
{
if(change(a , i) == b || change(b , i) == a){f = true;puts("YES");break;}
}
if(!f) puts("NO");
}
}