#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int n, k;
int a[maxn];
long long pre[maxn];
void read_input() {
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) cin >> a[i];
}
void init() {
  for (int i = 1; i <= n; ++i) pre[i] = pre[i - 1] + a[i];
}
vector<int> get_divs(int x) {
  vector<int> res;
  for (int i = 2; i * 1LL * i <= x; ++i)
    if (x % i == 0) {
      res.push_back(i);
      if (i * i != x) res.push_back(x / i);
    }
  return res;
}
void solve() {
  if (pre[n] % k != 0) {
    cout << "No\n";
    return;
  }
  int x = pre[n] / k;
  int cur = 1, lst = 0;
  vector<int> ans;
  for (int i = 1; i <= n; ++i)
    if (pre[i] == cur * x) {
      ans.push_back(i - lst);
      lst = i;
      ++cur;
    }
  if ((int)ans.size() != k) {
    cout << "No\n";
    return;
  }
  cout << "Yes\n";
  for (auto& x : ans) cout << x << ' ';
  cout << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  read_input();
  init();
  solve();
}
