program xmz;
var
f1,f2:text;
x:array[1..1000000]of integer;
y:array[1..2000]of longint;
a,n,m,c,i,j,aa,bb:longint;
begin
assign(f1,'exhibit.in');assign(f2,'exhibit.out');
reset(f1);rewrite(f2);
read(f1,n,m);
for a:=1 to n do
read(f1,x[a]);
i:=1;j:=1;y[x[1]]:=1;c:=1;bb:=n;
while j<n do
begin
j:=j+1;
y[x[j]]:=y[x[j]]+1;if y[x[j]]=1 then c:=c+1;
while y[x[i]]>1 do begin y[x[i]]:=y[x[i]]-1;i:=i+1;end;
if (c=m) and (j-i<bb-aa) then begin bb:=j;aa:=i;end;
end;
write(f2,aa,' ',bb);
close(f1);close(f2);
end.