program exhibit;
const
maxn= 1000000;
var
f1,f2:text;
data: array[1..maxn] of longint;
num: array[1..maxn] of longint;
i,j,k,n,m: longint;
l,r,a,b: longint;
min,tot: longint;
procedure init;
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,data[i]);
fillchar(num,sizeof(num),0);
end;
procedure main;
var
t:longint;
begin
min:=maxlongint;
tot:=0;
l:=0;r:=0;
repeat
if tot=m then begin
inc(l);
dec(num[data[l]]);
if num[data[l]]=0 then dec(tot);
end else begin
inc(r);
inc(num[data[r]]);
if num[data[r]]=1 then inc(tot);
end;
if tot=m then begin
t:=r-l;
if t<min then begin
min:=t;
a:=l; b:=r;
end;
end;
until r>=n;
end;
procedure print;
begin
writeln(f2,a+1,' ',b);
close(f1);
close(f2);
end;
begin
init;
main;
print;
end.