program waterfire;
const
fin='exhibit.in';
fout='exhibit.out';
var
n,m,x,y,i,j:longint;
data:array[1..1000000] of longint;
ppp:array[1..2000] of longint;
f:text;
s:longint;
d:longint;
b:array[1..2000] of boolean;
begin
j:=1;
d:=maxint;
fillchar(data,sizeof(data),0);
fillchar(ppp,sizeof(ppp),0);
fillchar(b,sizeof(b),false);
assign(f,fin);reset(f);
read(f,n,m);
for i:=1 to n do
begin
read(f,data[i]);
inc(ppp[data[i]]);
if ppp[data[i]]=1 then inc(s);
if s=m then begin
while ppp[data[j]]>1 do
begin
dec(ppp[data[j]]);
inc(j);
end;
if i-j<d then
begin
d:=i-j;
y:=i;
x:=j;
end;
end;
end;
close(f);
assign(f,fout);rewrite(f);
write(f,x,' ',y);
close(f);
end.