#include <bits/stdc++.h>
using namespace std;
const long double INF = 1LL << 60, EPS = 1LL >> 60;
int in() {
  char c;
  bool g = false;
  while (c = getchar(), c < '0' || c > '9')
    if (c == '-')
      g = true;
    else
      g = false;
  int x = 0;
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - 48;
    c = getchar();
  }
  return g ? -x : x;
}
void out(int x) {
  int len = 0, data[20];
  while (x) {
    data[len++] = x % 10;
    x /= 10;
  }
  if (!len) data[len++] = 0;
  if (data[0] != abs(data[0])) putchar('-');
  while (len--) putchar(abs(data[len]) + 48);
  putchar(' ');
}
void out(string s) {
  int len = 0;
  while (len++ < s.size()) putchar(s[len - 1]);
  putchar('\n');
}
long long a[100100], b[100100];
int main() {
  int n = in(), k = in(), x, y = 100100, s = 0;
  for (int i = 0; i < n; i++) {
    a[i] = in();
    if (!b[a[i]]) s++;
    b[a[i]]++;
    if (s == k) {
      y = i + 1;
      break;
    }
  }
  if (y == 100100) return out(-1), out(-1), out(""), 0;
  for (int i = 0; i < n; i++)
    if (b[a[i]] == 1) {
      x = i + 1;
      break;
    } else
      b[a[i]]--;
  out(x);
  out(y);
  out("");
  return 0;
}
