L=int(input()) N=int(input()) W=list(map(int,input().split())) W.sort() i=0 a=0 while i