n,m=map(int,input().split()) A=list(map(int,input().split())) l=[0] a=0 for i in range(n-1): a+=A[i] l.append(a) for i in range(len(l)-1): if l[i+1]-l[i]