#include <bits/stdc++.h>
using namespace std;
int main() {
  static long int i, n, k, x, c, t, a[100001], b[100001];
  cin >> n >> k;
  for (i = 1; i <= n; i++) {
    cin >> x;
    if (c != k) {
      if (b[x] == 0) c++;
      t = i;
      a[i] = x;
      b[x] = i;
    }
  }
  for (i = 1; i <= n; i++) {
    if (b[a[i]] == i) break;
  }
  if (c == k)
    cout << i << " " << t;
  else
    cout << "-1 -1";
  return 0;
}
