#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k, i, ans = 0;
  cin >> n >> k;
  int a[n + 2];
  int c[100005] = {0};
  for (i = 0; i < n; i++) {
    cin >> a[i];
    c[a[i]]++;
    if (c[a[i]] == 1) ans++;
  }
  if (ans < k) {
    cout << "-1 -1";
  } else {
    int r, l, en = n - 1, st = 0;
    r = n - 1;
    while (r >= 0) {
      if (ans < k) break;
      c[a[r]]--;
      if (c[a[r]] == 0) ans--;
      r--;
    }
    r++;
    if (ans < k) {
      c[a[r]]++;
      ans++;
      en = r;
    }
    l = 0;
    while (l < n) {
      if (ans < k) break;
      c[a[l]]--;
      if (c[a[l]] == 0) {
        ans--;
      }
      l++;
    }
    l--;
    if (ans < k) {
      c[a[l]]++;
      ans++;
      st = l;
    }
    cout << st + 1 << " " << en + 1;
  }
  return 0;
}
