#include <bits/stdc++.h>
using namespace std;
int n, k, cnt, a[555555], flag[2 * 555555];
int main() {
  while (~scanf("%d%d", &n, &k)) {
    memset(flag, 0, sizeof(flag));
    cnt = 0;
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      if (i <= k) {
        if (!flag[a[i]])
          cnt++, flag[a[i]] = 1;
        else
          flag[a[i]]++;
      }
    }
    int l = 1, r = k, ansl = 1, ansr = k;
    while (r < n) {
      if (flag[a[r + 1]] || cnt < k) {
        r++;
        if (flag[a[r]] == 0) cnt++;
        flag[a[r]]++;
        if (ansr - ansl < r - l) ansl = l, ansr = r;
      } else {
        if (flag[a[l]] == 1) cnt--;
        flag[a[l]]--;
        l++;
      }
    }
    printf("%d %d\n", ansl, ansr);
  }
  return 0;
}
