N,K = map(int,input().split()) A = list(map(int,input().split())) P = [0]*100010 for a in A: P[a] += 1 P.sort(reverse = True) c = 0 for i in range(len(P)): K -= P[i] if K <= 0: print(i+1) break