#include <bits/stdc++.h>
using namespace std;
const int mn = 100010;
int n, k;
int a[mn];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; ++i) {
    scanf("%d", a + i);
  }
  map<int, int> count;
  int l = 0, r = 0;
  while (r < n && count.size() < (size_t)k) {
    ++count[a[r]];
    ++r;
  }
  if (count.size() < (size_t)k) {
    puts("-1 -1");
  } else {
    while (count[a[l]] > 1) {
      --count[a[l]];
      ++l;
    }
    printf("%d %d\n", l + 1, r);
  }
  return 0;
}
