#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, sum = 0;
  cin >> n >> k;
  long long a[n + 2], ans[n + 2];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  if (sum % k != 0) {
    cout << "No" << endl;
    return 0;
  }
  long long s = sum / k;
  long long cnt = 0, j = 0;
  sum = 0;
  for (int i = 0; i < n; i++) {
    sum += a[i];
    cnt++;
    if (sum == s) {
      ans[j++] = cnt;
      cnt = 0;
      sum = 0;
    }
  }
  if (j == 0)
    cout << "No" << endl;
  else {
    cout << "Yes" << endl;
    for (int i = 0; i < j; i++) cout << ans[i] << " ";
    cout << endl;
  }
  return 0;
}
