#include <bits/stdc++.h>
using namespace std;
int n, m, a[100010], s[100010], sp, cnt;
long long tot, sum, pj;
int main() {
  cin >> n >> m;
  for (register int i = 1; i <= n; i++) cin >> a[i], tot += a[i];
  if (tot % m != 0) {
    cout << "No" << endl;
    return 0;
  }
  pj = tot / m;
  for (register int i = 1; i <= n; i++) {
    sum += a[i];
    if (sum == pj) {
      sum = 0;
      s[++cnt] = i - sp;
      sp = i;
    }
    if (sum > pj) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  for (register int i = 1; i <= cnt; i++) cout << s[i] << ' ';
  return 0;
}
