/* -*- coding: utf-8 -*- * * 3708.cc: No.3708 Uncommon Time - yukicoder */ #include #include #include using namespace std; /* constant */ const int MAX_P = 1231; /* typedef */ using vb = vector; /* global variables */ vb primes; /* subroutines */ void gen_primes(int maxp) { primes.assign(maxp + 1, true); primes[0] = primes[1] = false; for (int p = 2; p * p <= maxp; p++) if (primes[p]) { for (int q = p * p; q <= maxp; q += p) primes[q] = false; } } /* main */ int main() { gen_primes(MAX_P); int m, d; scanf("%d%d", &m, &d); int x = m * 100 + d; if (primes[x]) puts("Yes"); else puts("No"); return 0; }