program bing;
var
f1,f2:text;
n,m,x,y:longint;
a:array[1..100000] of longint;
b:array[1..2000] of boolean;
procedure init;
var
i:longint;
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]);
for i:=1 to m do b[i]:=false;
end;
procedure nb;
var i,j,k,t,min:longint;
begin
t:=0;
min:=n;
for i:=1 to n-m+1 do
begin
b[a[i]]:=true;
inc(t);
k:=i;
repeat
inc(K);
if b[a[k]]=false then
begin
b[a[k]]:=true;
inc(t);
end;
until (t=m)or(k=n);
for j:=1 to m do b[j]:=false;
if t=m then
if min>k-i+1 then
begin
min:=k-i+1;
x:=i;
y:=k;
end;
t:=0;
end;
end;
begin
init;
nb;
write(f2,x,' ',y);
close(f1);close(f2);
end.