about summary refs log tree commit diff
path: root/others/volume1/023.pas
diff options
context:
space:
mode:
Diffstat (limited to 'others/volume1/023.pas')
-rw-r--r--others/volume1/023.pas17
1 files changed, 17 insertions, 0 deletions
diff --git a/others/volume1/023.pas b/others/volume1/023.pas
new file mode 100644
index 0000000..6092889
--- /dev/null
+++ b/others/volume1/023.pas
@@ -0,0 +1,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.