L = int(input()) N = int(input()) W = [int(i) for i in input().split()] W.sort() sum=0 j=0 for a in range(N): if sum+W[j]