about summary refs log tree commit diff
path: root/others/volume1/052.pas
diff options
context:
space:
mode:
Diffstat (limited to 'others/volume1/052.pas')
-rw-r--r--others/volume1/052.pas24
1 files changed, 24 insertions, 0 deletions
diff --git a/others/volume1/052.pas b/others/volume1/052.pas
new file mode 100644
index 0000000..8a071a0
--- /dev/null
+++ b/others/volume1/052.pas
@@ -0,0 +1,24 @@
+uses clib;
+
+var
+  n, a: int16;
+  b: array of boolean;
+
+begin
+  readln(n);
+  setlength(b, n);
+  for n := n - 1 downto 0 do
+    b[n] := false;
+  for n := 1 to length(b) do
+    begin
+      read(a);
+      if (a <= 0) or
+         (a > length(b)) then
+        continue;
+      b[a - 1] := true
+    end;
+  if all(b) then
+    writeln('YES')
+  else
+    writeln('NO')
+end.