n,k = map(int,input().split()) A = sorted(list(map(int,input().split())),reverse=True) ans = 0 for i in range(1<