Polycarp took $n$ videos, the duration of the $i$-th video is $a_i$ seconds. The videos are listed in the chronological order, i.e. the $1$-st video is the earliest, the $2$-nd video is the next, ..., the $n$-th video is the last.

Now Polycarp wants to publish exactly $k$ ($1 \le k \le n$) posts in Instabram. Each video should be a part of a single post. The posts should preserve the chronological order, it means that the first post should contain one or more of the earliest videos, the second post should contain a block (one or more videos) going next and so on. In other words, if the number of videos in the $j$-th post is $s_j$ then:

  $s_1+s_2+\dots+s_k=n$ ($s_i>0$),  the first post contains the videos: $1, 2, \dots, s_1$;  the second post contains the videos: $s_1+1, s_1+2, \dots, s_1+s_2$;  the third post contains the videos: $s_1+s_2+1, s_1+s_2+2, \dots, s_1+s_2+s_3$;  ...  the $k$-th post contains videos: $n-s_k+1,n-s_k+2,\dots,n$. 

Polycarp is a perfectionist, he wants the total duration of videos in each post to be the same.

Help Polycarp to find such positive integer values $s_1, s_2, \dots, s_k$ that satisfy all the conditions above.


-----Input-----

The first line contains two integers $n$ and $k$ ($1 \le k \le n \le 10^5$). The next line contains $n$ positive integer numbers $a_1, a_2, \dots, a_n$ ($1 \le a_i \le 10^4$), where $a_i$ is the duration of the $i$-th video.


-----Output-----

If solution exists, print "Yes" in the first line. Print $k$ positive integers $s_1, s_2, \dots, s_k$ ($s_1+s_2+\dots+s_k=n$) in the second line. The total duration of videos in each post should be the same. It can be easily proven that the answer is unique (if it exists).

If there is no solution, print a single line "No".


-----Examples-----
Input
6 3
3 3 1 4 1 6

Output
Yes
2 3 1 
Input
3 3
1 1 1

Output
Yes
1 1 1 
Input
3 3
1 1 2

Output
No
Input
3 1
1 10 100

Output
Yes
3

Difficulty: competition

Starter code:

Solutions:
import sys
n,k = map(int, sys.stdin.readline().split())
arr = list(map(int, sys.stdin.readline().split()))
tot = sum(arr)
if tot % k != 0:
	print('No')
	return
tot //= k
idx,cur = 0,0
ans = []
for i in range(n):
	cur += arr[i]
	idx += 1
	if cur == tot:
		ans.append(idx)
		idx = 0
		cur = 0
	elif cur > tot:
		print('No')
		return
if sum(ans) != n:
	print('No')
	return
print('Yes')
for an in ans:
	print(an,end=' ')

n,k=list(map(int,input().split()))
arr=list(map(int,input().split()))
val=sum(arr)
if(val%k!=0):
    print('No')
else:
    flag=0
    i=0
    arr1=[]
    sumx=0
    count=0
    while(i<n):
        sumx+=arr[i]
        count+=1
        if(sumx==val//k):
            arr1.append(count)
            sumx=0
            count=0
        elif(sumx>val//k):
            flag=1
            break
        i+=1
    if(flag==1):
        print('No')
    else:
        print('Yes')
        print(*arr1)


n,k=map(int,input().split())
a=list(map(int,input().split()))
f=0
b=[]
p=sum(a)//k

q=0
c=0
for i in a:
	q+=i
	c+=1
	if p==q:
		b.append(c)
		c=0
		q=0
	elif q>p:
		f=1
		break
if f==1 or len(b)!=k or p!=sum(a)/k:
	print("No")
else:
	print("Yes")
	for i in b:
		print(i,end=" ")
	


import sys
n,k = list(map(int,input().split()))
l = list(map(int,input().split()))
if sum(l)%k:
    print("No")
else:
    curr = 0
    c = 0
    ans = []
    need = sum(l)//k
    for i in range(n):
        curr += l[i]
        c += 1
        if curr == need:
            ans.append(c)
            curr = 0
            c = 0
        elif curr > need:
            print("No")
            return
    print("Yes")
    print(*ans)


n,k = map(int,input().split());
arr = list(map(int,input().split()));
l = sum(arr);

if l%k==0:
	count = l//k;
	a = [-1]*(k+1);
	j=1;
	i = 0
	ptr1 = 0;
	flag=0;
	while(i<k):
		temp = 0;
		while(ptr1<n):
			temp += arr[ptr1];
			if temp == count:
				#print(ptr1)
				a[j] = ptr1;
				j+=1;
				ptr1+=1;
				break;
			elif temp > count:
				#print(ptr1,temp,count)
				flag = 1;
				break;
			ptr1+=1;
		if temp<count:
			flag =1;
		if flag==1:
			break;
		i+=1;
	if flag==1:
		print("No");
	else:
		print("Yes");
		#print(*a)
		for i in range(1,k+1):
			print(a[i]-a[i-1],end=" ");
		print()
else:	
	print("No")

n,k=[int(s) for s in input().split()]
s=[0 for i in range(k)]
a=[int(s) for s in input().split()]
b=[0 for i in range(n)]
b[0]=a[0]
def check():
    for i in range(1,n):
        b[i]=b[i-1]+a[i]
    cnt=0
    if(b[n-1]%k!=0):
        print('No')
        return
    m=b[n-1]/k
    for j in range(0,n):
        if b[j]%m==0:
            s[cnt]=j
            cnt+=1
    #print(s)
    if(cnt>=k):
        print('Yes')
        for i in range(k):
             if i==0:
                print(s[i]+1,end=" ")
             else:
                print(s[i]-s[i-1],end=" ")
        return
    else:
        print('No')
        return

check()

n, k = map( int, input().split() )
a = list( map( int, input().split() ) )

each = sum( a ) // k

r = []
s = 0
i = 0
m = 0
while i < n:
    s += a[ i ]
    m += 1
    if( s == each ):
        r.append( m )
        s = 0
        m = 0
    i += 1

if( s == 0 and i == n and m == 0 and len( r ) == k ):
    print( "Yes" )
    for i in r:
        print( i, end=" " )
else:
    print( "No" )



n, k = list(map(int, input().strip().split()))
A = list(map(int, input().strip().split()))
s = sum(A)
t =  s//k
if(s%t != 0):
    print("No")
else:
    final = []
    i = 0
    flag = True
    while(i!=n):
        s1 = 0
        temp = []

        while(s1<t and i<n):
            s1+=A[i]
            temp.append(A[i])
            #print("as",A[i], s1)
            i+=1
        #print(temp)
        if(s1!=t):
            #print("s",s1,t)
            flag=False
            break
        else:
            final.append(len(temp))

    if(flag is False):
        print("No")
    else:
        print("Yes")
        print(' '.join(list(map(str,final))))


n, k = list(map(int, input().split()))
L = list(map(int, input().split()))
p = sum(L)
if p % k == 0:
    M = []
    summa = 0
    count = 0
    f = True
    for i in L:
        if summa + i == p // k:
            M.append(count + 1)
            summa = 0
            count = 0
        elif summa + i > p // k:
            f = False
        else:
            summa += i
            count += 1
    if f and len(M) == k:
        print('Yes')
        print(*M)
    else:
        print('No')
else:
    print('No')
            


import sys
n,k=[int(x) for x in input().split()]
a=[int(x) for x in input().split()]
s=sum(a)
if s%k!=0:
    print("No")
    return
tot=s//k
ans=[]
cur=0
cursum=0
for i in a:
    cursum+=i
    cur+=1
    if cursum>tot:
        print("No")
        return        
    elif cursum==tot:
        ans.append(cur)
        cur=0;cursum=0
if cur!=0:
    print("No")
    return
print("Yes")
for i in ans:
    print(i,end=' ')

n,k = list(map(int, input().split()))
s = list(map(int,input().split()))
_sum = sum(s)
if( _sum % k != 0):
    print("No")
    return
V = _sum // k

idx = 0
current_val = 0
count = 0
ans = []
while idx < len(s):
    current_val += s[idx]
    count+=1
    if(current_val > V):
        print("No")
        return
    elif(current_val == V):
        ans.append(count)
        count = 0
        current_val = 0
    idx+=1
print("Yes")
print(' '.join(list(map(str,ans))))


n, k = map(int, input().split())
l = [*map(int, input().split())]

s = sum(l)
res = []
if s % k == 0:
    s //= k
    curr = 0
    prev = 0

    for i, e in enumerate(l):
        curr += e
        if curr == s:
            res.append(str(i - prev + 1))
            prev = i + 1
            curr = 0
        if curr > s:
            res = []
            break

    if curr != 0: res = []

if len(res) != k:
    print('No')
else:
    print('Yes')
    print(' '.join(res))


n, k = input().split()
n, k = int(n), int(k)
V = [int(s) for s in input().split()]
sumV = sum(V)
S = []
count = 0
currentLength = 0
possible = sumV % k == 0
target = sumV // k
for v in V:
    #print(str(count) + ' ' + str(currentLength))
    count += 1
    currentLength += v
    if currentLength == target:
        S.append(count)
        count = 0
        currentLength = 0
    elif currentLength > target:
        possible = False
        break
if possible: 
    print('Yes')
    for s in S:
        print(s, end=' ')
else:
    print('No')


n, k = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
s = sum(a)
if s % k != 0:
    print("No")
    return
rvl = s // k
vip =[]
tvip = 0
tvipl = 0
for cv in range(n):
    tvip += 1
    tvipl += a[cv]
    if tvipl > rvl:
        print("No")
        return
    elif tvipl == rvl:
        vip.append(tvip)
        tvip = 0
        tvipl = 0
print("Yes")
print(*vip, sep=' ')


n,k=map(int,input().split())
arr=list(map(int,input().split()))
ansarr=[]
m=0
su=0
ans=0
s=sum(arr)
le=s//k;
if(s%k!=0):
	print('No')
	return
else:
	for i in range(n):
		su+=arr[m]
		m+=1
		ans+=1
		if(su==le):
			ansarr.append(ans)
			ans=0
			su=0
		elif(su>le):
			print('No')
			return
print('Yes')
print(*ansarr)

temp = input().split(' ')
n = int(temp[0])
k = int(temp[1])
temp = input().split(' ')
mas = []
sum = 0
for i in range(n):
    mas.append(int(temp[i]))


for i in range(n):
    sum += mas[i]

d = 0

if sum%k:
    print('No')
    return
else:
    d = sum/k

rez = []
rez.append(0)
temp = 0
for i in range(n):
    temp += mas[i]

    if (temp == d):
        temp = 0
        rez.append(i+1)

    if (temp > d):
        print('No')
        return

print("Yes")
for i in range(1, len(rez)):
    print(rez[i] - rez[i-1], end = ' ')

v = []
n,k = map(int, input().split())
s = 0
v = [int(x) for x in input().split()]
s = sum(v)
w = []
if s % k != 0:
    print('No')
else:
    ss = s // k
    i = 0
    m = 0
    sm = 0
    while i < n:
        m = 0
        sm = 0
        while i < n and sm < ss:
            sm += v[i]
            m += 1
            i += 1
        if sm > ss:
            print('No')
            break
        else:
            w.append(m)
    else:
        print('Yes')
        for i in range(len(w)):
            print(w[i], end=' ')


def read():
    return list(map(int, input().split()))

def solve(n, k, A):
    if sum(A) % k != 0 :
        print('No')
        return
    target = sum(A) // k
    ans, elems, sm = [], 0, 0
    for num in A:
        sm += num
        elems += 1
        if sm > target:
            print('No')
            return
        if sm == target:
            ans.append(elems)
            elems, sm = 0, 0
    print('Yes')
    print(' '.join(map(str, ans)))

n, k = read()
A = read()
solve(n, k, A)



n,k=map(int,input().split())
l=list(map(int,input().split()))
if 1==k :
    print("Yes")
    print(n)
    return
su = sum(l)
if su%k!=0 :
    print("No")
    return
k1=su//k
t=0
k2=0
j1=[]
for i in l :
    t=t+i
    k2+=1
    if t == k1 :
        j1.append(k2)
        k2=0
        t=0
    if t > k1 :
        print("No");return
print("Yes")
print(*j1)

n,k=list(map(int,input().split()))
a=list(map(int,input().split()))
l=sum(a)
if(l%k!=0):
    print('No')
    return
else:
    z=l//k
    c=[]
    h=0
    q=0
    for i in range(len(a)):
        q+=a[i]
        if(q==z):
            c.append(i+1)
            q=0
    c.reverse()
    for i in range(len(c)-1):
        c[i]-=c[i+1]
    c.reverse()
    if(len(c)==k):
        print('Yes')
        print(*c)
    else:
        print('No')


n,k=map(int,input().split())
l=map(int,input().split())
l=[int(x) for x in l]
flag=True
result=[]
if sum(l)%k!=0:
    flag=False
    print("No")
else:
    length = sum(l) / k
    s=0
    for i in range(len(l)):
        s+=l[i]
        if s>length:
            print("No")
            flag=False
            break
        elif s==length:
            result.append(i+1)
            s=0
    if flag==True:
        print("Yes")
        for i in range(len(result)-1,0,-1):
            result[i]-=result[i-1]
        for number in result:
            print(number,end=" ")

3

'''
n, k = map(int, input().split())
days = list(map(int, input().split()))

nb_bags=0
crt_cap=0
for i in range(n):
	if crt_cap !=0:
		days[i] = max(days[i]-(k-crt_cap), 0)
		crt_cap = 0
		nb_bags += 1
	nb_bags += int(days[i]/k)
	crt_cap = days[i]%k

if crt_cap !=0:
	nb_bags += 1

print(nb_bags)
'''




n, k = map(int, input().split())
d = list(map(int, input().split()))

total = sum(d)


tab = []
tab2 = []

#tab[0] = True

som =0
nbV =0
for d0 in d:
	som+=d0
	nbV+=1
	tab.append(som)
	tab2.append(nbV)
#	tab[som]=True
#	tab2[som]=nbV

answer_list=[]

if total%k!=0:
	print("No")
else:
	d_unit = total//k
	u0 = d_unit
	v_cpt=0
	while u0<=total:
		if u0>total:
			break
		if not(u0 in tab):
#		if tab[u0]==False:
			break
		ind = tab.index(u0)
		answer_list.append(tab2[ind]-v_cpt)
		v_cpt=tab2[ind]
		u0+=d_unit
	if u0>total:
		print("Yes")
		print(*answer_list, sep=' ')
	else:
		print("No")




n, k = map(int, input().split())
a = list(map(int, input().split()))
s = sum(a)
if (s % k > 0):
    print("No")
else:
    p = s / k
    ar = []
    cur = 0
    l = 0
    for i in range(n):
        if a[i] + cur == p:
            ar.append(i - l + 1)
            l = i + 1
            cur = 0
            continue
        cur += a[i]
        if cur > p:
            print("No")
            break
    else:
        print("Yes")
        print(*ar)

n,k = list(map(int,input().split()))

s=[int(x) for x in input().split()]
sm =sum(s)
flag=1
if sm%k!=0:
    print('No')
    
else:
    vh=sm//k
    s1=[]
    acummu=0
    count=0
    for i in range(n):
        count+=1
        acummu+=s[i]
        if acummu>vh:
            print('No')
            flag=0
            break
        elif acummu==vh:
            acummu=0
            s1.append(count)
            count=0
    if flag: 
        print("Yes")
        print(*s1)




n,k = map(int,input().split())

s=[int(x) for x in input().split()]
sm =sum(s)
flag=1
if sm%k!=0:
    print('No')
    
else:
    vh=sm//k
    s1=[]
    acummu=0
    count=0
    for i in range(n):
        count+=1
        acummu+=s[i]
        if acummu>vh:
            print('No')
            flag=0
            break
        elif acummu<vh:
            continue
            
        elif acummu==vh:
            acummu=0
            s1.append(count)
            count=0
            
    if acummu!=0:
        s1.append((sm)//vh)
    if flag: 
        print("Yes")
        print(*s1)