#include <bits/stdc++.h>
using namespace std;
int main() {
  long long j = 1, s[100005], n, k, sum = 0, summ = 0, jl = 1, a[100005];
  cin >> n >> k;
  for (long long i = 1; i <= n; i++) {
    cin >> s[i];
    sum += s[i];
  }
  if (sum % k != 0) {
    cout << "No";
    return 0;
  }
  sum /= k;
  for (int i = 1; i <= n; i++) {
    summ += s[i];
    if (summ > sum) {
      cout << "No";
      return 0;
    }
    if (summ == sum) {
      a[j] = i - jl;
      j++;
      jl = i;
      summ = 0;
    }
  }
  cout << "Yes" << endl;
  a[1]++;
  for (int i = 1; i <= k; i++) {
    cout << a[i] << " ";
  }
  return 0;
}
