about summary refs log tree commit diff
path: root/others/volume1/061.pas
diff options
context:
space:
mode:
Diffstat (limited to 'others/volume1/061.pas')
-rw-r--r--others/volume1/061.pas21
1 files changed, 21 insertions, 0 deletions
diff --git a/others/volume1/061.pas b/others/volume1/061.pas
new file mode 100644
index 0000000..46bf839
--- /dev/null
+++ b/others/volume1/061.pas
@@ -0,0 +1,21 @@
+var
+  n, i: int16;
+  a, b: array of int16;
+
+begin
+  readln(n);
+  setlength(a, n);
+  setlength(b, n);
+  for i := 0 to n - 1 do
+    begin
+      read(a[i]);
+      b[a[i] - 1] := i + 1
+    end;
+  for i := 0 to n - 1 do
+    if a[i] <> b[i] then
+      begin
+        writeln('NO');
+        exit
+      end;
+  writeln('YES')
+end.