program exhibit;
var
no,ma,mb,min,m,k,n,i,j:longint;
a:array [1..2000] of longint;
b:array [1..1000000] of integer;
begin
fillchar(a,sizeof(a),0);
assign (input,'exhibit.in');
reset (input);
readln (n,m);
for i:=1 to n do read (b[i]);
close (input);
assign (output,'exhibit.out');
rewrite (output);
i:=1;j:=i;no:=0;min:=maxint;
while i<=n-m+1 do begin
if j>n then break;
if (a[b[j]]=0) then inc(no);
inc(a[b[j]]);
while no=m do begin
if a[b[i]]-1=0 then break else begin
dec(a[b[i]]);
inc(i);
end;
end;
if (j-i+1<min) and (no=m) then begin
min:=j-i+1;
ma:=i;
mb:=j;
end;
inc(j);
end;
writeln (ma,' ',mb);
close (output);
end.