Subscribe Us

Responsive Advertisement

Advertisement

80 A codeforces solution

 


 80 A codeforces

by ujjal roy




#include<bits/stdc++.h>

using namespace std;

main()

{

    int n,m,c=0,i;

    cin>>n>>m;

    n++;

    while(1)

    {

        c=0;

        for(i=2;i<=n/2;i++)

        {

            if(n%i==0)

            {

                c=1;

                break;

            }

        }

        if(c==0) break;

        else n++;


    }

    if(n==m) cout<<"YES"<<endl;

    else cout<<"NO"<<endl;

    return 0;

}


Post a Comment

0 Comments