#include <bits/stdc++.h>
using namespace std;
const int MAXN = 110000;
int v[MAXN];
int q[MAXN];
int head, tail;
int n, k, x, tmp;
bool f = 0;
int main() {
  head = 1;
  tail = 0;
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) {
    cin >> x;
    q[++tail] = x;
    if (v[x] == 0) ++tmp;
    ++v[x];
    while (v[q[head]] > 1) {
      --v[q[head]];
      ++head;
    }
    if (tmp == k) {
      cout << head << ' ' << tail << endl;
      f = 1;
      break;
    }
  }
  if (!f) cout << "-1 -1" << endl;
  return 0;
}
