#include <bits/stdc++.h>
int main() {
  int n, k, i, t = 0;
  scanf("%d%d", &n, &k);
  int a[n];
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    t = t + a[i];
  }
  if (t % k != 0)
    printf("No");
  else {
    int d = t / k;
    int r = 0, j, b[n], c = 0;
    for (i = 1, j = 0; i <= n; i++) {
      r = r + a[i];
      c++;
      if (r > d) {
        printf("No");
        return 0;
      } else if (r == d) {
        b[j] = c;
        c = 0;
        r = 0;
        j++;
      }
    }
    printf("Yes\n");
    for (i = 0; i < j; i++) {
      printf("%d ", b[i]);
    }
    return 0;
  }
  return 0;
}
