Const Fi='NGUYENTO.INP';
Fo='NGUYENTO.OUT';
Var f,g: text;
k: byte;
Function ngto(a: longint): boolean;
Var i: longint;
Begin
If a<2 then exit(false);
For i:=2 to a div 2 do
If a mod i = 0 then exit(false);
exit(true);
End;
Begin
Assign(f,Fi); Reset(f);
Assign(g,Fo); Rewrite(g);
Read(f,k);
If ngto(k) then Write(g,'Y')
Else Write(g,'N');
Close(f);
Close(g);
End.