#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
long long n, k;
long long v[200002];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
  cin >> n >> k;
  long long sum = 0;
  for (int i = 1; i <= n; ++i) cin >> v[i], sum += v[i];
  if (sum % k != 0) {
    cout << "No";
    return 0;
  }
  long long L = 0;
  long long gap = 0;
  vector<int> vv;
  for (int i = 1; i <= n; ++i) {
    ++gap;
    if (L + v[i] == sum / k)
      vv.push_back(gap), gap = 0, L = 0;
    else {
      if (L + v[i] < sum / k)
        L += v[i];
      else {
        cout << "No";
        return 0;
      }
    }
  }
  if (L != 0) {
    cout << "No";
    return 0;
  }
  cout << "Yes\n";
  for (int i = 0; i < k; ++i) cout << vv[i] << " ";
  return 0;
}
