#include <bits/stdc++.h>
using namespace std;
int const maxn = 5e5 + 100;
int const maxN = 1e6 + 100;
int a[maxn];
int f[maxN];
int main() {
  int n, k;
  scanf(" %d %d", &n, &k);
  int tam = -0x3f3f3f3f, l = 1, r = n;
  for (int i = 0; i < n; ++i) scanf(" %d", a + i);
  int T = 0;
  for (int j = 0, i = 0; j < n; ++j) {
    while (n > i && k >= T + (f[a[i]] == 0)) {
      f[a[i]]++;
      T += (f[a[i]] == 1);
      i++;
    }
    if (T == k && tam < (i - j)) {
      tam = i - j;
      l = j + 1;
      r = i;
    }
    T -= (--f[a[j]] == 0);
    if (n <= i) break;
  }
  return !printf("%d %d\n", l, r);
}
