#include <bits/stdc++.h>
using namespace std;
int n, k, a[100005], ans[100005], sum, tot;
int read() {
  int s = 0, w = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') s = s * 10 + ch - '0', ch = getchar();
  return s * w;
}
int main() {
  n = read(), k = read();
  for (int i = 1; i <= n; i++) {
    a[i] = read();
    sum += a[i];
  }
  if (sum % k) {
    cout << "No";
    return 0;
  }
  sum /= k;
  int now = 0, cnt = 0;
  for (int i = 1; i <= n; i++) {
    now++;
    cnt += a[i];
    if (cnt == sum) {
      ans[++tot] = now;
      now = cnt = 0;
    } else if (cnt > sum) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes" << endl;
  for (int i = 1; i <= k; i++) {
    cout << ans[i] << " ";
  }
}
