#include <bits/stdc++.h>
using namespace std;
int a[100010];
int ans[100010];
int sum;
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    sum += a[i];
  }
  int b = sum / k;
  if (b == 0 || sum % b) {
    cout << "No";
    return 0;
  }
  int now = 0, cnt = 0;
  int last = 0;
  for (int i = 1; i <= n; i++) {
    now += a[i];
    if (now == b) {
      ans[++cnt] = i - last;
      last = i;
      now = 0;
    }
    if (now > b) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes" << endl;
  for (int i = 1; i <= k; i++) {
    printf("%d ", ans[i]);
  }
  return 0;
}
