#include <iostream>
#include <fstream>
#define MAX 1000000
using namespace std;
ifstream fi("exhibit.in");
ofstream fo("exhibit.out");
int artist[MAX];
int cop[MAX];
int main()
{
int i,j,cnt=1,minlen,a,b,N,M;
fi >> N >> M;
minlen=N+1;
for (i=1;i<=N;i++)
fi >> artist[i];
cop[artist[i=j=1]]=1;
while (j<=N)
if (cnt<M)
{
if ((++cop[artist[++j]])==1)
cnt++;
}
else
{
if (j-i+1<minlen)
minlen=j-i+1,a=i,b=j;
if ((--cop[artist[i++]])==0)
cnt--;
}
fo << a << ' ' << b;
fi.close();fo.close();
return 0;
}