#include <bits/stdc++.h>
using namespace std;
int a[1000010];
int vis[1000010];
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  int p1 = 0, p2 = 0, l = 0, r = 0, sum = 0;
  while (p1 < n && p2 < n) {
    if (sum < k || (sum == k && vis[a[p2]] != 0)) {
      if (p2 - p1 >= r - l) l = p1, r = p2;
      if (++vis[a[p2]] == 1) sum++;
      p2++;
    } else {
      if (--vis[a[p1]] == 0) sum--;
      p1++;
    }
  }
  cout << l + 1 << " " << r + 1 << endl;
  return 0;
}
