You've got an array *a*, consisting of *n* integers: *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub>. Your task is to find a minimal by inclusion segment [*l*, *r*] (1 ≤ *l* ≤ *r* ≤ *n*) such, that among numbers *a*<sub class="lower-index">*l*</sub>,  *a*<sub class="lower-index">*l* + 1</sub>,  ...,  *a*<sub class="lower-index">*r*</sub> there are exactly *k* distinct numbers.

Segment [*l*, *r*] (1 ≤ *l* ≤ *r* ≤ *n*; *l*, *r* are integers) of length *m* = *r* - *l* + 1, satisfying the given property, is called minimal by inclusion, if there is no segment [*x*, *y*] satisfying the property and less then *m* in length, such that 1 ≤ *l* ≤ *x* ≤ *y* ≤ *r* ≤ *n*. Note that the segment [*l*, *r*] doesn't have to be minimal in length among all segments, satisfying the given property.
The first line contains two space-separated integers: *n* and *k* (1 ≤ *n*, *k* ≤ 10<sup class="upper-index">5</sup>). The second line contains *n* space-separated integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> — elements of the array *a* (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">5</sup>).
import sys
import math
from collections import deque,Counter
from sys import stdin

#sys.setrecursionlimit(10**7)

int1=lambda x: int(x)-1
stinput=lambda :stdin.readline()[:-1]
ii=lambda :int(stinput())
mi=lambda :map(int, stdin.readline().split())
li=lambda :list(mi())
mi1=lambda :map(int1, stdin.readline().split())
li1=lambda :list(mi1())
mis=lambda :map(str, stdin.readline().split())
lis=lambda :list(mis())

from collections import defaultdict
#d=defaultdict(int)
#d=defaultdict(lambda:1)

import heapq
#heapq.heapify(hq)
#heapq.heappop(hq)
#heapq.heappush(hq,1)

mod=10**9+7
Mod=998244353
INF=10**18
ans=0

n,m=mi()
a=li()
l=0
cnt=0
d=defaultdict(int)
r=-1
while cnt<m and r+1<n:
  r+=1
  if d[a[r]]==0:
    cnt+=1
  d[a[r]]+=1
if cnt<m:
  print(-1,-1)
  exit()
ans=r-l
ansl=l
ansr=r
for l in range(1,n):
  d[a[l-1]]-=1
  if d[a[l-1]]==0:
    cnt-=1
  while cnt<m and r+1<n:
    r+=1
    if d[a[r]]==0:
      cnt+=1
    d[a[r]]+=1
  if cnt==m:
    if ans>r-l:
      ans=r-l
      ansl=l
      ansr=r
print(ansl+1,ansr+1)