#include <bits/stdc++.h>
using namespace std;
int static fast = []() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  return 0;
}();
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> arr(n, 0);
  for (auto& val : arr) cin >> val;
  unordered_map<int, int> used;
  bool found = false;
  int slow = 0;
  for (int i = 0; i < n; i++) {
    used[arr[i]] += 1;
    if (used.size() == k) {
      int l = 0;
      while (used[arr[l]] > 1) {
        --used[arr[l++]];
      }
      cout << l + 1 << " " << i + 1 << "\n";
      found = true;
      break;
    }
  }
  if (!found) {
    cout << -1 << " " << -1 << "\n";
  }
  return 0;
}
