n,k=map(int,input().split()) L=list(map(int,input().split())) def f(x): cnt=0 for e in L: if e<=x: cnt+=1 if cnt==k: return -1 else: if k