about summary refs log tree commit diff
path: root/others/volume1/052.pas
blob: 8a071a0d38cc37711aadb9a58aa7d51261e02d0c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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.