#include <bits/stdc++.h>
using namespace std;
const int max_N = 1e5 + 10;
int a[max_N];
void fail() {
  cout << "No" << endl;
  exit(0);
}
int main() {
  do {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
  } while (0);
  int N, K;
  cin >> N >> K;
  int sum = 0;
  for (int i = 1; i <= N; ++i) {
    cin >> a[i];
    sum += a[i];
  }
  if (sum % K > 0) {
    fail();
  }
  int target = sum / K;
  int prev = 0;
  vector<int> ans;
  int j = 1;
  for (int i = 1; i <= K; ++i) {
    int res = target;
    while (j <= N && a[j] <= res) {
      res -= a[j];
      j++;
    }
    if (res != 0) {
      fail();
    }
    ans.push_back(j - 1 - prev);
    prev = j - 1;
  }
  cout << "Yes" << endl;
  for (auto& x : ans) {
    cout << x << ' ';
  }
  cout << endl;
}
