program exhibit(input,output);
var
i,j,k,max,ans:longint;
f1,f2:text;
a:array [1..1000000] of integer;
b:array [1..2000] of longint;
n,m:longint;
ansa,ansb:longint;
begin
assign(f1,'exhibit.in');
assign(f2,'exhibit.out');
reset(f1);
rewrite(f2);
readln(f1,n,m) ;
for i:=1 to n do
read(f1,a[i]);
i:=1; j:=1;
ans:=1;
b[a[j]]:=1;
max:=n;
ansa:=1;
ansb:=n;
while j<=n do
begin
if ans>=m then begin
if max>j-i+1 then
begin
ansa:=i;
ansb:=j;
max:=j-i+1;
end;
i:=i+1; dec(b[a[i-1]]);
if b[a[i-1]]=0
then
ans:=ans-1 ;
end
else begin
j:=j+1;
if b[a[j]]=0 then ans:=ans+1;
inc(b[a[j]]);
end;
end;
writeln(f2,ansa,' ',ansb);
close(f1);
close(f2);
end.