#include <bits/stdc++.h>
using namespace std;
const int nsz = 5e5, asz = 1e6;
int n, k, a[nsz + 5], cnt[asz + 5], rl, rr;
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
  }
  for (int l = 1, r = 1, cur = 0; l <= n; ++l) {
    for (; r <= n && cur < k; cur += !cnt[a[r]]++, ++r)
      ;
    for (; r <= n && cnt[a[r]]; ++cnt[a[r]], ++r)
      ;
    r - l >= rr - rl + 1 && (rl = l, rr = r - 1);
    cur -= !--cnt[a[l]];
  }
  printf("%d %d\n", rl, rr);
}
