#include <bits/stdc++.h>
using namespace std;
signed main() {
  std::ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long n, k;
  cin >> n >> k;
  long long sum = 0;
  vector<long long> a(n);
  vector<long long> ans;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  if (sum % k) {
    cout << "No";
    return 0;
  }
  long long curr = 0, m = sum / k, j = -1;
  for (long long i = 0; i < n; i++) {
    curr += a[i];
    if (curr == m) {
      ans.push_back(i - j);
      j = i;
      curr = 0;
    } else if (curr > m) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes" << endl;
  for (long long i = 0; i < ans.size(); i++) cout << ans[i] << " ";
  return 0;
}
