#include <bits/stdc++.h>
using namespace std;
bool mark[100001];
int main() {
  int t;
  ;
  t = 1;
  vector<int> arr;
  while (t--) {
    int n, k;
    cin >> n >> k;
    memset(mark, 0, sizeof(mark));
    arr.resize(n);
    for (int i = 0; i < n; i++) cin >> arr[i];
    int i, l, r, count;
    count = 0;
    for (i = 0; i < n; i++) {
      if (mark[arr[i]] == false) {
        count++;
        mark[arr[i]] = true;
        if (count == k) break;
      }
    }
    r = i;
    memset(mark, 0, sizeof(mark));
    count = 0;
    for (i; i < n && i >= 0; i--) {
      if (mark[arr[i]] == false) {
        count++;
        mark[arr[i]] = true;
        if (count == k) break;
      }
    }
    l = i;
    l++;
    r++;
    if (r > n)
      cout << "-1 -1" << endl;
    else
      cout << l << " " << r << endl;
  }
  return 0;
}
