program bing;
type
aa=array[1..2000] of longint;
var
f1,f2:text;
n,i,j,k,s:longint;
m,t:integer;
d:aa;
ai,bi:longint;
a:array[1..1000000] of integer;
begin
assign(f1,'exhibit.in');reset(f1);
assign(f2,'exhibit.out');rewrite(f2);
readln(f1,n,m);
for i:=1 to n do
read(f1,a[i]);
s:=1000000;
i:=1;j:=1;
k:=1;t:=1;
fillchar(d,sizeof(d),0);
d[a[1]]:=1;
for k:=2 to n do
begin
if a[k]=a[i] then
begin
inc(i);
dec(d[a[k]]);
if d[a[k]]=0 then dec(t);
end;
inc(j);
inc(d[a[k]]);
if d[a[k]]=1 then inc(t);
if t=m then
if s>j-i then
begin
s:=j-i;
ai:=i;bi:=j;
end;
end;
writeln(f2,ai,' ',bi);
close(f1);close(f2);
end.