#include <bits/stdc++.h>
using namespace std;
int n, k, i;
float d;
vector<int> v;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> k;
  int arr[n];
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    sum += arr[i];
  }
  d = sum / k;
  if (sum / k != (int)d) {
    cout << "No";
    return 0;
  }
  i = 0;
  while (i < n) {
    sum = 0;
    int cnt = 0;
    while (sum < (int)d) {
      sum += arr[i++];
      cnt++;
    }
    if (sum > (int)d) {
      cout << "No";
      return 0;
    }
    v.push_back(cnt);
  }
  cout << "Yes\n";
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
  return 0;
}
