#include <bits/stdc++.h>
using namespace std;
const int Z = (int)1e5 + 111;
int a[Z];
int main() {
  int n, k;
  long long sum = 0;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  if (sum % k) {
    cout << "No";
    return 0;
  }
  k = sum / k;
  sum = 0;
  int pred = 0;
  vector<int> ans;
  for (int i = 0; i < n; i++) {
    if (sum < k)
      sum += a[i];
    else if (sum == k) {
      sum = a[i];
      ans.push_back(i - pred);
      pred = i;
    } else {
      cout << "No";
      return 0;
    }
  }
  if (sum == k) {
    ans.push_back(n - pred);
  } else {
    cout << "No";
    return 0;
  }
  cout << "Yes\n";
  for (auto x : ans) cout << x << ' ';
  return 0;
}
