#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, k;
  cin >> n >> k;
  long long arr[n];
  long long soma = 0;
  for (long long i = 0; i < n; i++) cin >> arr[i], soma += arr[i];
  if (soma % k != 0) {
    cout << "No" << endl;
    return 0;
  }
  long long v = soma / k;
  long long c = 0, it = 0;
  vector<long long> ans;
  for (long long i = 0; i < n; i++) {
    c += arr[i];
    it++;
    if (c > v) {
      cout << "No" << endl;
      return 0;
    } else if (c == v) {
      ans.push_back(it);
      c = 0;
      it = 0;
    }
  }
  cout << "Yes" << endl;
  for (long long x : ans) {
    cout << x << ' ';
  }
  cout << endl;
}
