#include <bits/stdc++.h>
using namespace std;
int N, K, a[100005], sum, ans[100005], tot, col, cnt;
int main() {
  scanf("%d %d", &N, &K);
  for (int i = 1; i <= N; i++) {
    scanf("%d", &a[i]);
    sum += a[i];
  }
  if (sum % K) {
    printf("No\n");
    return 0;
  }
  sum /= K;
  for (int i = 1; i <= N; i++) {
    col += 1;
    cnt += a[i];
    if (cnt == sum) {
      tot++;
      ans[tot] = col;
      col = cnt = 0;
    } else if (cnt > sum) {
      printf("No\n");
      return 0;
    }
  }
  printf("Yes\n");
  for (int i = 1; i <= K; i++) {
    printf("%d ", ans[i]);
  }
  return 0;
}
