#include <bits/stdc++.h>
using namespace std;
template <typename... Args>
void dbg(Args... args) {
  ((cout << args << " "), ...);
}
const int INF = 1e9;
int main() {
  int n, k;
  cin >> n >> k;
  int b[n];
  for (auto &i : b) cin >> i;
  map<int, int> m;
  int ans = INF, pi = INF, pj = INF;
  for (int i = 0, j = 0; j < n; ++j) {
    m[b[j]]++;
    for (; m.size() > k; ++i) {
      m[b[i]]--;
      if (m[b[i]] == 0) m.erase(b[i]);
    }
    while (m.size() == k and m[b[i]] > 1) m[b[i++]]--;
    if (m.size() == k) return dbg(i + 1, j + 1), 0;
  }
  dbg("-1 -1");
}
