#include <bits/stdc++.h>
const double EPS = 1e-9;
const int MOD = 1000 * 1000 * 1000 + 7;
const int INF = 2000 * 1000 * 1000;
using namespace std;
int popcount(int n) {
  bitset<32> b(n);
  return b.count();
}
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  int arr[100005] = {0};
  int cnt = 0;
  int l = 0, r = -1;
  bool solflag = 1;
  while (1) {
    if (cnt < k && r <= n - 1) {
      r++;
      if (!arr[v[r]]) cnt++;
      arr[v[r]]++;
    }
    if (cnt >= k && l >= 0) {
      if (arr[v[l]] > 1) {
        arr[v[l]]--;
        l++;
      } else
        break;
    }
    if (r == n - 1 && cnt < k) {
      solflag = 0;
      break;
    }
  }
  if (!solflag)
    cout << "-1 -1" << endl;
  else
    cout << l + 1 << " " << r + 1 << endl;
  return 0;
}
