#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, j, l;
  long long sum = 0, count = 0;
  cin >> n >> k;
  vector<int> a(n), s(k);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  if (sum % k == 0) {
    count = sum / k;
    j = 0;
    l = 0;
    int sum1 = 0;
    for (int i = 0; i < n; i++) {
      if (j < k) {
        if (sum1 + a[i] < count) {
          sum1 += a[i];
          l++;
        } else if (sum1 + a[i] == count) {
          l++;
          sum1 += a[i];
          s[j] = l;
          l = 0;
          j++;
          sum1 = 0;
        } else {
          cout << "No";
          return 0;
        }
      }
    }
  } else {
    cout << "No";
    return 0;
  }
  cout << "Yes" << endl << s[0];
  for (int i = 1; i < k; i++) cout << ' ' << s[i];
  return 0;
}
