#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  vector<int> V(n);
  for (int i = 0; i < n; ++i) cin >> V[i];
  int ind = 0, ans = 1e9, cur = 0, l, r;
  map<int, int> M;
  for (int i = 0; i < n; ++i) {
    if (i > 0) {
      M[V[i - 1]]--;
      if (M[V[i - 1]] == 0) cur--;
    }
    while (ind < n && cur < k) {
      M[V[ind]]++;
      if (M[V[ind]] == 1) cur++;
      ind++;
    }
    if (cur == k && ans > ind - i) {
      ans = ind - i;
      l = i + 1, r = ind;
    }
  }
  if (ans == 1e9)
    cout << "-1 -1\n";
  else
    cout << l << " " << r << "\n";
  return 0;
}
