#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  map<int, int> m;
  int i = 0, j = 0, first = -2, last = -2;
  while (i < n) {
    m[a[i]]++;
    while (j <= i && m.size() >= k) {
      if (m.size() == k) {
        first = j;
        last = i;
      }
      m[a[j]]--;
      if (m[a[j]] == 0) m.erase(a[j]);
      j++;
    }
    i++;
  }
  cout << first + 1 << " " << last + 1 << endl;
}
