#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int a[n], tmp[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (i == 0) {
      tmp[i] = a[i];
    } else {
      tmp[i] = tmp[i - 1] + a[i];
    }
  }
  if (tmp[n - 1] % k != 0) {
    cout << "No";
    return 0;
  }
  vector<int> v;
  int sum = 0, fn = -1;
  for (int i = 0; i < n; i++) {
    if (tmp[i] == sum + tmp[n - 1] / k) {
      sum += tmp[n - 1] / k;
      v.push_back(i - fn);
      fn = i;
    } else if (tmp[i] > sum + tmp[n - 1] / k) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes\n";
  for (auto c : v) {
    cout << c << ' ';
  }
  return 0;
}
