#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[100005];
int b[100005];
int main() {
  scanf("%d %d", &n, &m);
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    sum += a[i];
  }
  if (sum % m != 0)
    printf("No\n");
  else {
    int ave = sum / m;
    int tmp = 0, times = 0, tot = 0;
    for (int i = 0; i < n; i++) {
      tmp += a[i];
      times++;
      if (tmp < ave) continue;
      if (tmp == ave) b[tot++] = times, times = 0, tmp = 0;
      if (tmp > ave) {
        printf("No\n");
        return 0;
      }
    }
    printf("Yes\n");
    for (int i = 0; i < tot; i++) printf("%d ", b[i]);
  }
  return 0;
}
