#include <bits/stdc++.h>
using namespace std;
const int maxn = 500005;
map<int, int> vis;
int n, k, a[maxn], ans, tot, now, l, r;
int main(void) {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  ans = -1;
  now = 1;
  l = r = 1;
  for (int i = 1; i <= n;) {
    while (tot <= k && now <= n) {
      if (!vis[a[now]]) tot++;
      vis[a[now]]++;
      now++;
      if (now > n && tot <= k) {
        if (now - i > ans) ans = now - i, l = i, r = n;
        break;
      }
    }
    if (now - 1 - i > ans) ans = now - 1 - i, l = i, r = now - 2;
    if (now > n) break;
    while (tot > k && i <= n) {
      vis[a[i]]--;
      if (!vis[a[i]]) tot--;
      i++;
    }
  }
  printf("%d %d\n", l, r);
  return 0;
}
