#include <bits/stdc++.h>
using namespace std;
bool ktsnt(long long n)
{
long long i;
if(n<2) return false;
else
{
for(i=2;i<=sqrt(n);i++)
if(n%i==0)
return false;
return true;
}
}
long long cnt;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
cin>>cnt;
if(ktsnt(cnt)==true)
cout<<"YES";
else
cout<<"NO";
return 0;
}
var i,n,dem:integer;
begin
write('Nhap n = ');readln(n);
for i:=1 to n do
begin
if n mod i = 0 then dem:=dem+1;
end;
if dem = 2 then write(n,' la so nguyen to')
else write(n,' khong la so nguyen to');
readln;
end.