I,R=input,range def J(): return map(int,I().split()) N,K=J() A=list(J()) B=[0]*N for a in A:B[a]+=1 a=0 for b in sorted(B): a+=1 if K