#include <bits/stdc++.h>
using namespace std;
int INF = 1e9;
int const N = 1e6 + 16;
int const M = 1e9 + 7;
int const M2 = 999999983;
int n, k;
int f[N];
int a[N];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; ++i) scanf("%d", a + i);
  int x = 1, y = 1, r = 1;
  int diff = 0;
  for (int l = 1; l <= n; ++l) {
    while (r <= n && (f[a[r]] || diff < k)) diff += (f[a[r++]]++ == 0);
    if (r - l > y - x + 1) x = l, y = r - 1;
    diff -= (--f[a[l]] == 0);
  }
  printf("%d %d\n", x, y);
}
