program z8_10;
uses crt;
const n=4;m=5;
var a:array[1..n,1..m]of integer;
i,j:integer;
BEGIN
clrscr;
randomize;
for i:=1 to n do begin
for j:=1 to m do
begin
a[i,j]:=random(20)+2;
write(a[i,j]:7);
end;
writeln; end;
j:=1;
i:=n+1;
while (j<=n) and (i>n) do begin
i:=1;
while (i<=j) and (a[i,j]<=a[i,j]) do
inc(i);
if iwhile (i<=n) and (a[i,j]>a[j,j]) do
inc(i);
inc(j);
end;
if i>n then writeln('yes')
else writeln(' no');readln;
end.