#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 256;
const char nxt = '\n';
inline void in(string Q) {
  Q += ".in";
  freopen(Q.c_str(), "r", stdin);
}
inline void out(string Q) {
  Q += ".out";
  freopen(Q.c_str(), "w", stdout);
}
inline void open_file(string Q) {
  in(Q);
  out(Q);
}
int n, k, a[MAXN], l, r, mn = INT_MAX, u[MAXN], Q[MAXN], L, R;
int main() {
  if (0) open_file("");
  scanf("%d", &n);
  scanf("%d", &k);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
  int cur = 1;
  while (l < n && r < n) {
    if (cur == k && r - l + 1 < mn) {
      mn = r - l + 1;
      L = l + 1;
      R = r + 1;
    }
    if (!Q[r]) {
      u[a[r]]++;
      Q[r] = 1;
    }
    if (cur < k) {
      if (!u[a[r + 1]]) cur++;
      r++;
    } else {
      u[a[l]]--;
      if (u[a[l]] == 0) cur--;
      l++;
    }
    if (cur == k && r < n && l < n && r - l + 1 < mn) {
      mn = r - l + 1;
      L = l + 1;
      R = r + 1;
    }
  }
  if (mn == INT_MAX) L = R = -1;
  cout << L << ' ' << R << nxt;
  return 0;
}
