#include <bits/stdc++.h>
using namespace std;
int N, K;
vector<int> vi;
int cnt[1000000 + 10];
int jud(int m) {
  int l, r;
  int res = -1;
  int i, j, k;
  l = r = k = 0;
  for (i = 0; i < N; i++) {
    if (cnt[vi[i]] == 0)
      k++, cnt[vi[i]]++;
    else
      cnt[vi[i]]++;
    r++;
    if (k > K) {
      for (j = l; j < r; j++) {
        cnt[vi[j]]--;
        if (cnt[vi[j]] == 0) k--;
        l++;
        if (k <= K) break;
      }
    }
    if (r - l >= m) res = l;
  }
  if (r - l >= m && k <= K) res = l;
  for (i = l; i < N; i++) cnt[vi[i]]--;
  return res;
}
int main() {
  int i, j, k;
  int n, m;
  cin >> N >> K;
  vi.resize(N);
  for (i = 0; i < N; i++) {
    scanf("%d", &vi[i]);
  }
  int l, r;
  int L, R;
  l = 0, r = N;
  while (l < r) {
    int tl, tr;
    m = (l + r + 1) / 2;
    tl = jud(m);
    if (tl != -1)
      l = m, L = tl, R = tl + m - 1;
    else
      r = m - 1;
  }
  cout << L + 1 << " " << R + 1 << endl;
  return 0;
}
