#include <bits/stdc++.h>
using namespace std;
const int MN = 1e5 + 10;
int adadha[MN];
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    adadha[i] = a;
  }
  int jam = 0;
  for (int i = 0; i < n; i++) {
    jam = jam + adadha[i];
  }
  if (jam % k != 0) {
    cout << "No" << endl;
  } else {
    int real_jam = jam / k;
    vector<int> tedad_har_daste;
    int felan = 0;
    int j = -1;
    int tamoomiat = 0;
    for (int i = 0; i < n; i++) {
      felan = felan + adadha[i];
      if (felan == real_jam) {
        tedad_har_daste.push_back(i - j);
        j = i;
        felan = 0;
      } else if (felan > real_jam) {
        cout << "No" << endl;
        tamoomiat = 1;
        break;
      }
    }
    if (tamoomiat == 0) {
      cout << "Yes" << endl;
      for (int i = 0; i < k; i++) {
        cout << tedad_har_daste[i] << " ";
      }
    }
  }
  return 0;
}
