#include <bits/stdc++.h>
using namespace std;
int a[100005], v[100005];
int main() {
  int n, k, i, j;
  while (~scanf("%d%d", &n, &k)) {
    for (i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
    }
    int st = 1, dr = 1, num = 0;
    memset(v, 0, sizeof(v));
    while (dr <= n && num < k) {
      if (!v[a[dr]]) num++;
      v[a[dr++]]++;
    }
    if (num < k) {
      printf("-1 -1\n");
      continue;
    }
    while (1) {
      if (v[a[st]] > 1) {
        v[a[st]]--;
        st++;
      } else {
        printf("%d %d\n", st, dr - 1);
        break;
      }
    }
  }
  return 0;
}
