#include using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int M,D; cin >> M >> D; int Need = 10000; vector prime(Need+1,true); prime.at(0) = false; prime.at(1) = false; for(int i=2; i*i<=Need; i++){ if(!prime.at(i)) continue; for(int k=i*i; k<=Need; k+=i) prime.at(k) = false; } M = M*100+D; if(prime.at(M)) cout << "Yes\n"; else cout << "No\n"; }