blob: 6092889930c1912b2e1e6b398be7045704692565 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
uses strutils, cmath;
var
n, u: int64;
s: string;
code: word;
begin
readln(n);
str(n, s);
val(reversestring(s), u, code);
if isprime(n) and
isprime(u) then
writeln('YES')
else
writeln('NO')
end.
|