program exhibit;
const
maxn=1000000;
maxm=2000;
var
data:array[1..maxn] of integer;
x:array [1..maxm] of longint;
num,i,j,a,b,max,n,m:longint;
procedure init;
var
i,j:longint;
begin
assign(input,'exhibit.in');
reset(input);
assign(output,'exhibit.out');
rewrite(output);
readln(n,m);
for i:=1 to n do read(data[i]);
close(input);
end;
procedure main;
begin
i:=1;
j:=1;
x[data[j]]:=1;
num:=1;
max:=n;
a:=1;
b:=n;
while j<=n do
begin
if num=m then
begin
if j-i+1<max then
begin
a:=i;
b:=j;
max:=j-i+1;
end;
inc(i);
dec(x[data[i-1]]);
if x[data[i-1]]=0 then dec(num);
end
else begin
inc(j);
if x[data[j]]=0 then inc(num);
inc(x[data[j]]);
end;
end;
end;
procedure print;
begin
writeln(a,' ',b);
close(output);
end;
begin
init;
main;
print;
end.