n,m=list(map(int,input().split())) a=list(map(int,input().split())) a.sort() a.reverse() t=0 s=[] l=0 for i in range(n): if (t