#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  scanf("%d %d\n", &n, &k);
  vector<int> a(n);
  for (auto&& ax : a) scanf("%d", &ax);
  int ans_l = 0, ans_r = 0;
  map<int, int> ma;
  int r = 0;
  for (int l = 0; l < n; ++l) {
    while (r < n && (ma.size() < k || ma.count(a[r]))) {
      ++ma[a[r]];
      ++r;
    }
    if (r - l > ans_r - ans_l) ans_r = r, ans_l = l;
    --ma[a[l]];
    if (ma[a[l]] == 0) ma.erase(a[l]);
  }
  printf("%d %d\n", ans_l + 1, ans_r);
  return 0;
}
