#include <bits/stdc++.h>
using namespace std;
int main(){
int n,m,h=0,h2=0;
cin>>n>>m;
for(int y=1;y<=n;y++){
if(n%y==0){
h+=y;
h+=n/y;
}
}
for(int i=1;i<=m;i++){
if(m%i==0){
h2+=i;
h2+=m/i;
}
}
if(h==h2){
cout<<"yes";
}else{
cout<<"no";
}
}
/**************************************************************
Problem: 1862
User: yangjunwen
Language: C++
Result: Accepted
Time:45 ms
Memory:2072 kb
****************************************************************/