#include <bits/stdc++.h>
using namespace std;
int a[100005], ans[100005];
int main() {
  int n, k, sum = 0;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  if (n < k || sum % k != 0)
    cout << "No" << endl;
  else if (k == 1)
    cout << "Yes" << endl << n << endl;
  else {
    int cnt = 0;
    for (int i = 0; i < n; i++) {
      int s = 0, len = 0;
      while (i < n) {
        s += a[i++];
        len++;
        if (s == sum / k) break;
      }
      i--;
      ans[cnt++] = len;
    }
    if (cnt == k) {
      cout << "Yes" << endl;
      for (int i = 0; i < cnt; i++) cout << ans[i] << " ";
      cout << endl;
    } else
      cout << "No" << endl;
  }
  return 0;
}
