#include <bits/stdc++.h>
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  int a[n];
  int sum = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    sum += a[i];
  }
  if (sum % k != 0) {
    printf("No\n");
    return 0;
  }
  int b[n];
  for (int i = 0; i < n; i++) b[i] = 0;
  int bin = 0;
  int aim = sum / k;
  int s;
  for (int i = 0; i < n;) {
    s = 0;
    while (s < aim) {
      s += a[i];
      i++;
      b[bin]++;
    }
    if (s != aim) {
      printf("No\n");
      return 0;
    }
    bin++;
  }
  printf("Yes\n");
  b[bin] = 0;
  bin = 0;
  while (b[bin]) {
    printf("%d ", b[bin]);
    bin++;
  }
}
