#include using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(0); constexpr int r = 2000; vector tb(r + 1); for(int i = 2; i <= r; i++){ if(tb[i]) continue; for(int j = 2 * i; j <= r; j += i) tb[j] = true; } int a, b; cin >> a >> b; cout << (!tb[100 * a + b] ? "Yes" : "No") << '\n'; }