#include <bits/stdc++.h>
int n, m, a[100005], sum, ans[100005], len;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; sum += a[i++]) scanf("%d", a + i);
  if (sum % m) return puts("No") * 0;
  int num = 0, sm = 0, p = sum / m, lnum = 0;
  while (sm <= p && num < n) {
    sm += a[num++];
    if (sm == p)
      ans[len++] = num - lnum, lnum = num, sm = 0;
    else if (sm > p)
      return puts("No") * 0;
  }
  puts("Yes");
  for (int i = 0; i < len; printf("%d ", ans[i++]))
    ;
}
