#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
long long INF = 1e18;
void solve() {
  int n, k, l, r, diff, minsz, start;
  cin >> n >> k;
  int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  if (k == 1) {
    cout << "1 1";
    return;
  }
  unordered_map<int, int> mp;
  diff = 1;
  l = 0;
  mp[arr[0]]++;
  r = 1;
  while (diff < k && r < n) {
    if (mp.find(arr[r]) == mp.end()) diff++;
    mp[arr[r]]++;
    r++;
  }
  if (diff < k) {
    cout << "-1 -1";
    return;
  }
  while (l < r && mp[arr[l]] > 1) {
    mp[arr[l]]--;
    l++;
  }
  cout << l + 1 << " " << r;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int test;
  test = 1;
  for (int t = 1; t <= test; t++) {
    solve();
  }
  return 0;
}
