#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N=1e6+10;
int x,y;string tx,ty;
string cg(int x){
string res;
while(x){
if(x&1) res+='1';
else res+='0';
x=x>>1;
}
reverse(res.begin(),res.end());
return res;
}
string cg2(string s){
while(s.back()=='0') s.pop_back();
reverse(s.begin(),s.end());
return s;
}
map<string,int> mp;
int32_t main(){
cin>>x>>y;tx=cg(x);ty=cg(y);
int fl=0;queue<string> q;q.push(tx);
while(q.size()){
auto tp=q.front();q.pop();
if(tp==ty) {cout<<"YES"<<endl;return 0;}
for(int i=1;i<=2;i++){
string k;
if(i==1){
k=cg2(tp+'0');
}else{
k=cg2(tp+'1');
}
if(mp.count(k)==0&&k.size()<=ty.size()){mp[k]=1;q.push(k);}
}
}
cout<<"NO"<<endl;
}