#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, k;
  cin >> n >> k;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long p2 = 0;
  map<long long, long long> m;
  long long dis = 0;
  for (long long i = 0; i < n; i++) {
    m[a[i]]++;
    if (m[a[i]] == 1) {
      dis++;
    }
    while (dis >= k and p2 <= i) {
      if (dis == k) {
        if (m[a[p2]] == 1 and m[a[i]] == 1) {
          cout << p2 + 1 << " " << i + 1;
          return 0;
        }
      }
      m[a[p2]]--;
      if (m[a[p2]] == 0) {
        dis--;
      }
      p2++;
    }
    if (dis == k) {
      if (m[a[p2]] == 1 and m[a[i]] == 1) {
        cout << p2 + 1 << " " << i + 1;
        return 0;
      }
    }
  }
  cout << -1 << " " << -1;
}
