#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100005;
int n, k;
int a[MAX_N];
int cnt[MAX_N];
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  int l = 1;
  int res = 1e9;
  int L = -1;
  int R = -1;
  int CNT = 0;
  for (int r = 1; r <= n; r++) {
    cnt[a[r]]++;
    if (cnt[a[r]] == 1) ++CNT;
    if (CNT < k) continue;
    while (CNT > k && l <= r) {
      cnt[a[l]]--;
      if (cnt[a[l]] == 0) CNT--;
      l++;
    }
    while (CNT == k && l <= r) {
      if (cnt[a[l]] == 1) break;
      cnt[a[l]]--;
      l++;
    }
    cout << l << ' ' << r;
    return 0;
  }
  cout << -1 << ' ' << -1;
  return 0;
}
