def Main(): n,k=map(int,input().split()) a=list(map(int,input().split())) count=0 b=0 ans=0 for i in range(n): if i==n-1: if a[i]>=a[i-1]: count+=1 elif a[i]>=a[i+1]: count+=1 if count==k: ans=i b=1 break for i in range(n-2,-1,-1): if b: break if a[i]