#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9;
const double PI = 2 * acos(0.0);
const double eps = 1e-9;
const int NPOS = -1;
const int MAX = 100022;
int n, k, l, r, sm;
array<int, MAX> frq, arr;
pair<int, int> ans = make_pair(-1, -1);
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> k;
  for (int i = int(0); i < int(n); ++i) cin >> arr[i];
  while (r < n) {
    while (r < n && sm < k) {
      if (frq[arr[r]] == 0) ++sm;
      ++frq[arr[r]];
      ++r;
    }
    if (sm == k) {
      ans = make_pair(l + 1, r);
      break;
    }
  }
  if (ans.first != NPOS)
    for (int i = int(ans.first - 1); i < int(r); ++i) {
      --frq[arr[i]];
      if (frq[arr[i]] == 0) {
        ans.first = i + 1;
        break;
      }
    }
  cout << ans.first << ' ' << ans.second << '\n';
  return 0;
}
