program check_g;

uses
  testlib, symbols;

var
  i, n, sum, prod: longint;
  a: array [0..101] of longint;

begin
  n := inf.readlongint;

  sum := 0;
  prod := 1;
  for i := 1 to n do
  begin
    a[i] := ouf.readlongint;
    if (a[i] <= 0) or (a[i] > n) then
      quit(_wa, 'sequence contains: ' + str(a[i], 0));
    sum := sum + a[i];
    prod := prod * a[i];
    if prod > n * n then
      quit(_wa, 'step: ' + str(i, 0) + ' - product is already to great');
  end;

  if sum <> prod then
    quit(_wa, 'n: ' + str(n, 0) + '; sum: ' + str(sum, 0) + '; prod: ' + str(prod, 0));

  quit(_ok, 'n: ' + str(n, 0) + '; sum: ' + str(sum, 0) + '; prod: ' + str(prod, 0));
end.