#include <bits/stdc++.h>
using namespace std;
long long arr[100005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, k, cnt = 0;
  long long sum = 0;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
    sum += arr[i];
  }
  if (sum % k != 0) {
    cout << "No\n";
    return 0;
  }
  long long p = sum / k, tot = 0;
  sum = 0;
  vector<int> vec;
  for (int i = 1; i <= n; i++) {
    tot++;
    sum += arr[i];
    if (sum == p) {
      vec.push_back(tot);
      tot = 0;
      cnt++;
      sum = 0;
    }
  }
  if (cnt != k) {
    cout << "No\n";
    return 0;
  }
  cout << "Yes\n";
  for (int i = 0; i < vec.size(); i++) {
    cout << vec[i];
    if (i != vec.size() - 1)
      cout << " ";
    else
      cout << endl;
  }
}
