#include <bits/stdc++.h>
using namespace std;
long long b;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, m, sum = 0, p, c = 0, s = 0, d = 0, j;
  cin >> n >> m;
  vector<long long> v, v1;
  for (long long i = 0; i < n; i++) {
    cin >> b;
    v.push_back(b);
    sum += b;
  }
  p = sum / m;
  for (long long i = 0; i < n; i++) {
    s += v[i];
    d++;
    if (s == p) {
      c++;
      v1.push_back(d);
      j = i;
      d = 0;
      s = 0;
    }
  }
  if ((c == m) && (j == n - 1)) {
    cout << "Yes" << endl;
    for (long long i = 0; i < (long long)v1.size(); i++) {
      cout << v1[i] << " ";
    }
  } else
    cout << "No";
}
