#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
int main() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(30);
  ;
  long long int n, k;
  cin >> n >> k;
  long long int a[n];
  for (int i = 0; i < n; ++i) cin >> a[i];
  long long int is[100002] = {0}, st = 0, cnt = 0;
  std::pair<long long int, long long int> ans = {-1e9, -1e2};
  for (int i = 0; i < n; ++i) {
    if (is[a[i]] == 0) cnt++;
    is[a[i]]++;
    while (cnt == k) {
      if (ans.second - ans.first > i - st) ans = {st, i};
      is[a[st]]--;
      if (is[a[st]] == 0) cnt--;
      st++;
    }
  }
  cout << max(ans.first + 1, -1ll) << ' ' << max(1 + ans.second, -1ll) << '\n';
  return 0;
}
