#include <bits/stdc++.h>
using namespace std;
long long mod = 10e9 + 7;
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
long long modularExp(long long x, long long n, long long mod) {
  long long result = 1;
  while (n > 0) {
    if (n % 2 == 1) result = (result * x) % mod;
    x = ((x % mod) * (x % mod)) % mod;
    n = n / 2;
  }
  return (result) % mod;
}
bool isPrime(long long n) {
  for (long long i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
int main() {
  long long n, k;
  cin >> n >> k;
  vector<long long> v(n);
  long long i;
  map<long long, long long> mp;
  for (i = 0; i < n; i++) {
    cin >> v[i];
    mp[v[i]] += 1;
  }
  if (mp.size() < k) {
    cout << "-1 -1";
    return 0;
  }
  map<long long, long long> pt;
  long long l = 0, r = 0;
  while (r < n) {
    pt[v[r]] += 1;
    if (pt.size() == k) break;
    r += 1;
  }
  while (1) {
    if (pt[v[l]] >= 2) {
      pt[v[l]] -= 1;
      l++;
    } else
      break;
  }
  cout << l + 1 << " " << r + 1;
}
