n,w=map(int,input().split()) A=[int(input()) for i in range(n)] Q=set() S=0 r=0 ANS=0 for i in range(n): while r