L = int(input()) N = int(input()) wide = list(map(int, input().split())) wide.sort() i = 0 sum = 0 for i in range(N): if sum +wide[i]