#include <bits/stdc++.h>
int s[100005] = {0}, a[100005];
int main() {
  int n, i, j, k, ap = 0;
  scanf("%d%d", &n, &k);
  for (i = 0; i < n; ++i) scanf("%d", &a[i]);
  i = 0;
  j = -1;
  while (ap < k && j < n)
    if (s[a[++j]]++ == 0) ++ap;
  if (j == n) {
    printf("-1 -1");
    return 0;
  }
  while (--s[a[i]]) ++i;
  printf("%d %d", i + 1, j + 1);
}
