#include <bits/stdc++.h>
using namespace std;
int a[1000000];
int p[1000000];
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  p[0] = a[0];
  for (int i = 1; i < n; i++) {
    p[i] = a[i] + p[i - 1];
  }
  int res = p[n - 1] / k;
  if (res * k != p[n - 1]) {
    cout << "No";
    return 0;
  }
  int tks = 0;
  int tkk = 0;
  vector<int> ans;
  for (int i = 0; i < n; i++) {
    tks += a[i];
    tkk++;
    if (tks > res) {
      cout << "No";
      return 0;
    }
    if (tks == res) {
      ans.push_back(tkk);
      tkk = 0;
      tks = 0;
    }
  }
  cout << "Yes\n";
  for (auto q : ans) {
    cout << q << " ";
  }
  return 0;
}
