#include <bits/stdc++.h>
using namespace std;
const int MAX = 212345;
class hasher {
 public:
  size_t operator()(const int& x) const { return x; }
};
int main(int argc, char const* argv[]) {
  cin.tie(0);
  cin.sync_with_stdio(0);
  int n, k;
  cin >> n >> k;
  int a[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  int ans_l = -1, ans_r = -1;
  int l = k, r = n;
  while (l <= r) {
    int mid = (l + r) / 2;
    bool ok = false;
    map<int, int> m;
    set<int> s(a, a + mid);
    for (int i = 0; i < mid; ++i) {
      m[a[i]]++;
    }
    if (s.size() >= k) {
      ok = true;
      ans_l = 1;
      ans_r = mid;
    } else {
      for (int i = mid; i < n; ++i) {
        m[a[i - mid]]--;
        if (m[a[i - mid]] == 0) s.erase(a[i - mid]);
        m[a[i]]++;
        s.insert(a[i]);
        if (s.size() >= k) {
          ok = true;
          ans_l = i - mid + 2;
          ans_r = i + 1;
          break;
        }
      }
    }
    if (ok)
      r = mid - 1;
    else
      l = mid + 1;
  }
  cout << ans_l << " " << ans_r << endl;
  return 0;
}
