program exhibit(input,output);
const
minlint=2000000;
var
a:array[1..1000000]of integer;
b:array[1..2000]of longint;
maxi,maxj,m,n,num,min:longint;
procedure ini;
var i:longint;
begin
assign(input,'exhibit.in');assign(output,'exhibit.out');
reset(input);rewrite(output);
readln(n,m);
for i:=1 to n do read(a[i]);
for i:=1 to m do b[i]:=0;
end;
procedure main;
var i,j:longint;
begin
i:=1; j:=0; min:=minlint; num:=0;
while j<=n do begin
if num=m then
begin
if j-i+1<min then
begin
min:=j-i+1;
maxi:=i;
maxj:=j;
end;
dec(b[a[i]]);
if b[a[i]]=0 then dec(num);
inc(i);
end
else begin
inc(j);
if j=n+1 then break;
if b[a[j]]=0 then inc(num);
inc(b[a[j]]);
end;
end;
write(maxi,' ',maxj);
close(input);close(output);
end;
begin
ini;
main;
end.