#include <bits/stdc++.h>
using namespace std;
int a[100010], f[100010];
void Solve_This_Shit() {
  int n, k, c = 0;
  bool e = 0;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    f[a[i]]++;
    (f[a[i]] == 1 ? c++ : 0);
    if (c == k) {
      int ans = 1;
      while (f[a[ans]] > 1) f[a[ans++]]--;
      printf("%d %d", ans, i), e = 1;
      break;
    }
  }
  (!e ? printf("-1 -1") : 0);
}
int main() {
  int t = 1;
  while (t--) Solve_This_Shit();
}
