#include <bits/stdc++.h>
using namespace std;
const int maxn = 4e5 + 10;
const int maxm = 1e6 + 10;
const long long INF = 1e16;
const int inf = 0x3f3f3f3f;
const long long mod = 19260817;
const int maxblock = sqrt(maxn) + 10;
int n, k;
int a[maxn];
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  vector<int> ans;
  int sum = 0;
  for (int i = 1; i <= n; i++) sum += a[i];
  if (sum % k) {
    cout << "No\n";
    return 0;
  }
  sum /= k;
  int sum1 = 0;
  int num = 0;
  for (int i = 1; i <= n; i++) {
    sum1 += a[i];
    num++;
    if (sum1 == sum) {
      ans.push_back(num);
      num = 0;
      sum1 = 0;
    }
  }
  if (sum1 == sum) {
    ans.push_back(num);
    num = 0;
  }
  if (ans.size() != k) {
    cout << "No\n";
  } else {
    cout << "Yes\n";
    for (int i = 0; i < k; i++) cout << ans[i] << " ";
    cout << endl;
  }
  return 0;
}
