#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, k;
  cin >> n >> k;
  vector<long long> v(n);
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    sum += v[i];
  }
  vector<long long> ans;
  if (sum % k != 0) {
    cout << "No" << endl;
    return 0;
  }
  long long len = 0;
  long long curr = 0;
  long long req = sum / k;
  for (int i = 0; i < n; i++) {
    curr += v[i];
    len++;
    if (curr == req) {
      ans.push_back(len);
      len = 0;
      curr = 0;
    }
  }
  if (accumulate(ans.begin(), ans.end(), 0LL) == n) {
    cout << "Yes" << endl;
    for (int x : ans) cout << x << " ";
    cout << endl;
  } else
    cout << "No" << endl;
}
