#include <bits/stdc++.h>
using namespace std;
int cnt[100005] = {0};
int main() {
  int n, k, i, j, id, l, r, dif = 0;
  scanf("%d%d", &n, &k);
  int ar[n + 5];
  map<int, int> mp;
  for (i = 0; i < n; i++) {
    scanf("%d", &ar[i]);
  }
  l = 0;
  r = 0;
  dif = 0;
  while (dif < k && r < n) {
    if (cnt[ar[r]] == 0) dif++;
    cnt[ar[r]]++;
    r++;
  }
  if (r == n && dif != k)
    printf("-1 -1\n");
  else {
    while (cnt[ar[l]] > 1) {
      cnt[ar[l]]--;
      l++;
    }
    printf("%d %d\n", (l + 1), r);
  }
  return 0;
}
