#include <bits/stdc++.h>
using namespace std;
int flag[100004];
int input[100004];
int main() {
  int n, k;
  while (cin >> n >> k) {
    memset(flag, 0, sizeof(flag));
    int i;
    for (i = 0; i < n; i++) {
      scanf("%d", &input[i]);
    }
    int l = 0;
    int r = 0;
    int t = 0;
    while (t < k) {
      if (r >= n) break;
      if (flag[input[r]] == 0) t++;
      flag[input[r]]++;
      r++;
    }
    while (l < r) {
      if (flag[input[l]] > 1)
        flag[input[l++]]--;
      else
        break;
    }
    if (t < k)
      cout << -1 << " " << -1 << endl;
    else
      cout << l + 1 << " " << r << endl;
  }
  return 0;
}
