#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  long long int a[n + 1];
  int m = 1;
  int flag = 0;
  while (m <= n) {
    cin >> a[m++];
  }
  int first = 0, last = 1;
  int count = 0;
  int b[100001] = {0};
  first = 1;
  for (int j = 1; j <= n; j++) {
    if (b[a[j]] == 0) {
      count++;
    }
    b[a[j]]++;
    if (count == k) {
      last = j;
      flag = 1;
      break;
    }
  }
  while (b[a[first]] > 1) {
    b[a[first]]--;
    first++;
  }
  if (flag)
    cout << first << " " << last;
  else
    cout << -1 << " " << -1;
}
