#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n, k;
  cin >> n >> k;
  int s = 0;
  vector<int> v(n);
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    v[i] = x;
    s += x;
  }
  if (s % k)
    cout << "No\n";
  else {
    int tot = 0, how = 0;
    int should = s / k;
    bool ok = true;
    vector<int> a;
    for (int i = 0; i < n; ++i) {
      if (tot + v[i] <= should) {
        tot += v[i];
        how++;
      } else {
        ok = false;
      }
      if (tot == should) {
        a.push_back(how);
        how = 0;
        tot = 0;
      }
    }
    if (ok && how == 0) {
      cout << "Yes\n";
      for (int x : a) cout << x << " ";
      cout << '\n';
    } else {
      cout << "No\n";
    }
  }
}
