#include <bits/stdc++.h>
using namespace std;
int INF = std::numeric_limits<int>::max();
long long LLINF = std::numeric_limits<long long>::max();
int NINF = std::numeric_limits<int>::min();
int MOD = 1e9 + 7;
int cc[] = {1, 2, 2, 1, -1, -1, -2, -2};
int rr[] = {-2, -1, 1, 2, -2, 2, 1, -1};
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> arr(n);
  for (int i = 0; i < n; ++i) cin >> arr[i];
  vector<int> freq(1e5 + 5, 0);
  freq[arr[0]]++;
  int cnt = 1, l = 0, r = 0, mn = INF, finl = -1, finr = -1;
  while (l < n && r < n) {
    if (l > r) {
      ++r;
      cnt += (freq[arr[r]] == 0);
      freq[arr[r]]++;
    }
    if (cnt == k) {
      if (r - l + 1 < mn) {
        mn = r - l + 1;
        finl = l + 1, finr = r + 1;
      }
      freq[arr[l]]--;
      if (freq[arr[l]] == 0) cnt--;
      l++;
    } else {
      r++;
      if (r == n) continue;
      if (freq[arr[r]] == 0) cnt++;
      freq[arr[r]]++;
    }
  }
  cout << finl << " " << finr;
  return 0;
}
