#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  set<long long> s;
  long long i = 0;
  s.insert(a[0]);
  long long j = 1;
  long long ans = n;
  long long low = -1, high = -1;
  map<long long, long long> c;
  c[a[0]]++;
  if (k == 1 && n >= 1) {
    cout << 1 << " " << 1;
    return 0;
  }
  while (j < n) {
    s.insert(a[j]);
    c[a[j]]++;
    if (s.size() == k) {
      while (s.size() == k) {
        if (c[a[i]] == 1) {
          s.erase(a[i]);
          c[a[i]] = 0;
        } else {
          c[a[i]]--;
        }
        i++;
      }
      cout << i << " " << j + 1;
      return 0;
    }
    j++;
  }
  cout << -1 << " " << -1;
  return 0;
}
