#include <bits/stdc++.h>
using namespace std;
int a[1234567];
set<int> s;
int pre, ne;
int posl = -1, posr = -1;
int rp[1234567];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  int l = 0, r = 0;
  int maxm = 0;
  s.insert(a[0]);
  r = 0;
  rp[a[0]] = 0;
  for (int i = 1; i < n; i++) {
    r++;
    pre = s.size();
    if (s.find(a[i]) == s.end()) s.insert(a[i]);
    ne = s.size();
    rp[a[i]] = i;
    if (ne <= k) {
      if ((r - l + 1) >= maxm) {
        maxm = r - l + 1;
        posl = l;
        posr = r;
      }
    } else {
      l++;
      if (rp[a[l - 1]] < l && s.find(a[l - 1]) != s.end()) s.erase(a[l - 1]);
    }
  }
  int sz = s.size();
  if (sz == k) {
    if ((r - l + 1) >= maxm) {
      maxm = r - l + 1;
      posl = l;
      posr = r;
    }
  }
  printf("%d %d", posl + 1, posr + 1);
  return 0;
}
