#include <bits/stdc++.h>
const long long mod = 1e9 + 7;
using namespace std;
const int nax = 1e5 + 9;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  int sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  vector<int> ans;
  if (sum % k != 0) {
    cout << "No";
    return 0;
  } else {
    int val = sum / k, temp_sum = 0, temp_cnt = 0;
    for (int i = 0; i < n; i++) {
      temp_cnt++;
      temp_sum += a[i];
      if (temp_sum == val) {
        ans.push_back(temp_cnt);
        temp_cnt = 0;
        temp_sum = 0;
      } else if (temp_sum > val) {
        cout << "No";
        return 0;
      }
    }
  }
  cout << "Yes"
       << "\n";
  for (auto i : ans) cout << i << " ";
  cout << "\n";
  ;
  return 0;
}
