#include <bits/stdc++.h>
using namespace std;
int n, k;
vector<int> v;
int freq[1000000] = {};
int main() {
  scanf("%d%d", &n, &k);
  v.resize(n);
  for (int i = 0; i < n; i++) scanf("%d", &v[i]);
  int l = 0, r = 0, sum = 0;
  int nl = 0, nr = -1;
  while (nr < n) {
    nr++;
    if (nr < n) {
      freq[v[nr]]++;
      if (freq[v[nr]] == 1) sum++;
      while (sum > k) {
        freq[v[nl]]--;
        if (freq[v[nl]] == 0) sum--;
        nl++;
      }
      if (sum <= k && (nr - nl) > (r - l)) {
        r = nr, l = nl;
      }
    }
  }
  printf("%d %d", l + 1, r + 1);
  return 0;
}
