#include <bits/stdc++.h>
using namespace std;
int A[100005], N, K, S, L, Num, Ans[100005], r;
int main() {
  scanf("%d%d", &N, &K);
  for (int i = 1; i <= N; i++) scanf("%d", &A[i]);
  for (int i = 1; i <= N; i++) S += A[i];
  if (S % K != 0) {
    cout << "No\n" << endl;
    return 0;
  }
  S /= K;
  for (int i = 1; i <= N; i++) {
    L += A[i];
    if (L == S) {
      Num++;
      Ans[++r] = i;
      L = 0;
    }
    if (L > S) {
      cout << "No\n";
      return 0;
    }
  }
  if (L != 0) {
    cout << "No\n";
    return 0;
  }
  if (Num != K) {
    cout << "No\n";
    return 0;
  }
  cout << "Yes\n";
  for (int i = 1; i <= r; i++) cout << Ans[i] - Ans[i - 1] << " ";
  return 0;
}
