#include <bits/stdc++.h>
using namespace std;
map<int, int> mymap;
int a[110000];
int cnt[110000];
int main() {
  int ll, rr, l, r, n, k, ans = 1000000, now;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  if (k == 0) {
    printf("-1 -1\n");
    return 0;
  }
  if (k == 1) {
    printf("1 1\n");
    return 0;
  }
  l = r = 1;
  cnt[a[1]]++;
  now = 1;
  while (l < n) {
    if (now < k && r < n) {
      r++;
      if (cnt[a[r]] == 0) now++;
      cnt[a[r]]++;
    } else {
      cnt[a[l]]--;
      if (cnt[a[l]] == 0) now--;
      l++;
    }
    if (now == k) {
      if (r - l + 1 < ans) {
        ll = l;
        rr = r;
        ans = r - l + 1;
      }
    }
  }
  if (ans == 1000000) ll = rr = -1;
  printf("%d %d", ll, rr);
  return 0;
}
