#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k, n, sum = 0;
  cin >> n >> k;
  int a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  if (sum % k != 0) {
    cout << "No";
    return 0;
  }
  sum = sum / k;
  vector<int> v;
  j = 0;
  for (i = 0; i < k; i++) {
    int temp = 0;
    int l = j;
    while (temp < sum) {
      temp += a[j];
      j++;
    }
    if (temp != sum) {
      cout << "No";
      return 0;
    }
    v.push_back(j - l);
  }
  cout << "Yes\n";
  for (i = 0; i < k; i++) cout << v[i] << " ";
}
