#include <bits/stdc++.h>
using namespace std;
long bb[100001];
int main() {
  long n, k, a[100000];
  scanf("%ld%ld", &n, &k);
  for (int i = 1; i <= 100001; i++) bb[i] = 0;
  for (int i = 0; i < n; i++) {
    scanf("%ld", &a[i]);
  }
  long r = 1, l = 0;
  long j = 1;
  bool b;
  set<long> s;
  s.insert(a[0]);
  bb[a[0]]++;
  while (j < k && r < n) {
    b = true;
    if (s.find(a[r]) == s.end()) {
      j++;
      s.insert(a[r]);
      bb[a[r]]++;
    } else
      bb[a[r]]++;
    r++;
  }
  while (1) {
    if (bb[a[l]] > 1) {
      l++;
      bb[a[l - 1]]--;
    } else
      break;
  }
  if (j == k)
    printf("%ld %ld", l + 1, r);
  else
    printf("-1 -1");
}
