#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> A(n), cnt(1e5 + 5);
  int dist = 0;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
    if (!cnt[A[i]]) dist++;
    cnt[A[i]]++;
  }
  if (dist < k)
    cout << "-1 -1";
  else {
    int l = 0, u = n - 1;
    while (l <= u) {
      if (cnt[A[u]] == 1 and dist == k) break;
      cnt[A[u]]--;
      if (!cnt[A[u]]) dist--;
      u--;
    }
    while (l <= u) {
      if (cnt[A[l]] == 1 and dist == k) break;
      cnt[A[l]]--;
      l++;
    }
    cout << l + 1 << " " << u + 1;
  }
  return 0;
}
