#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
  const auto no_solution = []() {
    cout << "No";
    return 0;
  };
  int a, k, n;
  cin >> n >> k;
  vector<int> sum = {0};
  for (int i = 0; i < n; i++) cin >> a, sum.push_back(sum.back() + a);
  int total = sum.back(), q = total / k, r = total % k;
  if (r > 0) return no_solution();
  auto it = sum.cbegin(), iu = sum.cend(), iv = it;
  vector<int> p;
  for (int s = q; s <= total; s += q)
    if (*(iv = lower_bound(it, iu, s)) == s)
      p.push_back(iv - it - 1);
    else
      return no_solution();
  cout << "Yes" << '\n' << p.front() + 1;
  for (int i = 0, j = 1, l = p.size(); j < l; i = j++)
    cout << ' ' << p[j] - p[i];
}
