#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T gcd(T a, T b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
template <typename T>
inline T lcm(T a, T b) {
  return (a * b) / gcd(a, b);
}
int n, t, m, a[100005 + 5], b[100005 + 5], c, k, l, r;
int main() {
  scanf("%d%d", &n, &k);
  memset(b, 0, sizeof b);
  for (int i = (1), _b = (n); i <= _b; i++) scanf("%d", &a[i]);
  r = c = 0;
  l = 1;
  for (int i = (1), _b = (n); i <= _b; i++) {
    if (b[a[i]]) {
      b[a[i]] = i;
      if (a[i] == a[l]) {
        while (b[a[l]] != l) l++;
      }
      continue;
    }
    b[a[i]] = i;
    c++;
    if (c == k) {
      r = i;
      break;
    }
  }
  if (r)
    printf("%d %d\n", l, r);
  else
    printf("-1 -1\n");
  return 0;
}
