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