Var n: Longint;
Procedure Doc;
  Begin
      Assign(input,'snton.inp'); Reset(input);
      Assign(output,'snton.out'); Rewrite(output);
      Read(n);
  End;
Function Nto(p:Qword):Boolean;
Var o: Longint;
  Begin
      If (p < 2) then exit(False);
      For o:= 2 to Trunc(Sqrt(p)) do
        If (p mod o = 0) then exit(false);
      Exit(True);
  End;
Procedure Xl;
  Begin
      If Nto(n) then Write('YES')
      else Write('NO');
  End;
begin
    Doc;
    Xl;
End.