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