#include <bits/stdc++.h>
using namespace std;
long long max(long long x, long long y) {
  if (x > y) return x;
  return y;
}
long long min(long long x, long long y) {
  if (x < y) return x;
  return y;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k;
  cin >> n >> k;
  int a[n];
  map<int, int> mp;
  for (int i = 0; i < n; i++) cin >> a[i];
  int start = 0, end = 0;
  int distinct = 0;
  bool flag = false;
  while (end < n) {
    if (mp.find(a[end]) == mp.end()) {
      mp[a[end]] = 1;
      distinct++;
    } else {
      mp[a[end]]++;
    }
    if (distinct == k) {
      flag = true;
      while (1) {
        if (mp[a[start]] > 1) {
          mp[a[start]]--;
          start++;
        } else
          break;
      }
      break;
    }
    end++;
  }
  if (flag) {
    cout << start + 1 << " " << end + 1 << endl;
  } else {
    cout << -1 << " " << -1 << endl;
  }
  return 0;
}
