#include<bits/stdc++.h>
using namespace std;
typedef long long ll
bool isprime(ll n )
{
if(n==2||n==3) return 1;
if( n%6==2 || n%6==3 || n%6==4 || n%6==0 ) //if( n%6==2 || n%6==3 || n%6==4)
return 0;
for(int i=5; i*i<=n ;i+=6 ) {
if(n%i==0 || n%(i+2)==0 ) return 0;
}
return 1;
}
int main()
{
ll L,R;
while(cin>>L>>R) {
int cn=0,flag=0;
if( R-L>=50 ) cout<<"no"<<"\n";
else {
for( int i=L;i<=R;i++ ) {
if( isprime(i) ) cn++;
if( (R-L)%2==0 && cn==1+(R-L+1)/2 ) {
flag=1;
break; }
if( (R-L)%2==1 && cn==(R-L+1)/2 ) {
flag=1;
break; } }
if( flag ) cout<<"yes"<<"\n";
else cout<<"no"<<"\n";
}
}
return 0;
}
bool is(ll n){
if(n<=1)return 0;
for(int i=2;i<=n/i;i++){ //最大时间复杂度也才 50* 根号下1e9
if(n%i==0)return 0;
}
return 1;
}
int main(){
ll l,r;
while(cin>>l>>r){
int sum=0;
if(r-l<=50){
for(ll i=l;i<=r;i++){
if(is(i))sum++;
}
// cout<<sum<<endl;
// cout<<0.5*(r-1+1)<<"\n";
// cout<<1.0*sum<<endl<<0.5*(r-l+1)<<endl;
// 学会调试
if(1.0*sum>=0.5*(r-l+1)){ //大于等于一半
cout<<"yes"<<"\n";
}
else cout<<"no"<<"\n";
}
else {
cout<<"no\n";
}
}
return 0;
}