#include <bits/stdc++.h>
using namespace std;
int a[100010];
int c[100010];
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int flag = 0;
  int sum = 0;
  int l = 0, r = 0;
  for (int i = 1; i <= n; i++) {
    if (c[a[i]]) continue;
    c[a[i]] = 1;
    sum++;
    if (sum == k) {
      r = i;
      flag = 1;
      break;
    }
  }
  sum = 0;
  memset(c, 0, sizeof(c));
  for (int i = r; i >= 1; i--) {
    if (c[a[i]]) continue;
    c[a[i]] = 1;
    sum++;
    if (sum == k) {
      l = i;
      break;
    }
  }
  if (flag)
    cout << l << " " << r << endl;
  else
    cout << -1 << " " << -1 << endl;
  return 0;
}
