#include <bits/stdc++.h>
using namespace std;
using namespace std;
const int mod = (int)1e9 + 7;
const long long INF = 10000005;
const int N = 100005;
int a[N];
int f[N];
int main() {
  int n, k, k1 = 1;
  cin >> n >> k;
  for (int(i) = 0; (i) < (n); ++(i)) cin >> a[i];
  int r = 1, l = 1;
  f[a[0]] = 1;
  while (r < n && k1 < k) {
    if (f[a[r]] == 0) k1++;
    f[a[r]]++;
    r++;
  }
  if (k1 == k) {
    while (f[a[l - 1]] > 1) {
      f[a[l - 1]]--;
      l++;
    }
    cout << l << " " << r << endl;
  } else
    cout << -1 << " " << -1 << endl;
}
