← Home
 ```go
package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	reader := bufio.NewReader(os.Stdin)
	var n, k int
	fmt.Fscan(reader, &n, &k)

	a := make([]int, n)
	total := 0
	for i := 0; i < n; i++ {
		fmt.Fscan(reader, &a[i])
		total += a[i]
	}

	if total%k != 0 {
		fmt.Println("No")
		return
	}

	target := total / k
	currentSum := 0
	currentSize := 0
	sizes := make([]int, 0, k)

	for i := 0; i < n; i++ {
		currentSum += a[i]
		currentSize++

		if currentSum == target {
			sizes = append(sizes, currentSize)
			currentSum = 0
			currentSize = 0
		} else if currentSum > target {
			fmt.Println("No")
			return
		}
	}

	if len(sizes) == k && currentSum == 0 {
		fmt.Println("Yes")
		for i, s := range sizes {
			if i > 0 {
				fmt.Print(" ")
			}
			fmt.Print(s)
		}
		fmt.Println()
	} else {
		fmt.Println("No")
	}
}
```