aboutsummaryrefslogtreecommitdiff
path: root/codeforces/ParanormixPredictions/main.cpp
blob: 771fafc5f26fecb8ea94a118934c0f907bc9e395 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include<bits/stdc++.h>

using namespace std;

int main () {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  vector<int> primes;
  for(int i = 2; i <= 50;i++) {
    bool ok = 1;
    for(int j = 2; j * j <= i; j++) {
      if(i % j == 0) {
        ok = 0;
        break;
      }
    }
    if(ok) {
      primes.push_back(i);
    }
  }
  int indx = (upper_bound(primes.begin(), primes.end(), n) - primes.begin());
  (m == primes[indx]) ? cout << "YES" : cout << "NO";
}