#include <bits/stdc++.h>
using namespace std;
const int N = 1e6;
int a[N];
int c[N];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  long long ans = 0;
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  int l, r, x = 0;
  bool ex = false;
  int ansl = -1e9, ansr = 1e9;
  l = 0;
  for (r = 0; r < n; r++) {
    c[a[r]]++;
    if (c[a[r]] == 1) {
      x++;
    }
    while (c[a[l]] > 1) {
      c[a[l]]--;
      l++;
    }
    if (x == k) {
      printf("%d %d\n", l + 1, r + 1);
      return 0;
    }
  }
  puts("-1 -1");
}
