#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long t = 1;
  while (t--) {
    long long n, k;
    scanf("%lld%lld", &n, &k);
    long long a[n];
    for (long long i = 0; i < n; i++) scanf("%lld", &a[i]);
    long long left = 0, right = -1, al = 0, ar = 0;
    map<long long, long long> m;
    while (right < n - 1) {
      m[a[++right]]++;
      while (m.size() > k) {
        m[a[left]]--;
        if (m[a[left]] == 0) long long ul = m.erase(a[left]);
        left++;
      }
      if (m.size() <= k && (right - left) >= (ar - al))
        ar = right + 1, al = left + 1;
    }
    printf("%lld %lld", al, ar);
  }
  return 0;
}
