#include <bits/stdc++.h>
using namespace std;
int ar[100005];
int main() {
  int n, k, cur = 0, ansl = -1, ansr = -1;
  cin >> n >> k;
  map<int, int> dis;
  for (int i = 1; i <= n; i++) cin >> ar[i];
  for (int i = 1; i <= n; i++) {
    if (!dis[ar[i]]) cur++;
    dis[ar[i]]++;
    if (cur == k) {
      int j = 1;
      while (dis[ar[j]] > 1) {
        dis[ar[j]]--;
        j++;
      }
      ansl = j;
      ansr = i;
      break;
    }
  }
  cout << ansl << " " << ansr << endl;
  return 0;
}
