#include <bits/stdc++.h>
const long long llinf = 0x3f3f3f3f3f3f3f3f;
const int inf = 0x3f3f3f3f;
using namespace std;
const int maxn = int(1e5 + 10);
int a[maxn];
int num[maxn];
int main() {
  int n, k;
  while (~scanf("%d", &n)) {
    scanf("%d", &k);
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    int sum(0);
    for (int i = 1; i <= n; i++) sum += a[i];
    if (sum % k) {
      cout << "No" << endl;
    } else {
      int cut = sum / k;
      int rest(0), cnt(1), last(0);
      bool flag(1);
      for (int i = 1; i <= n + 1; ++i) {
        if (rest + a[i] == cut) {
          rest = 0;
          num[cnt++] = i - last;
          last = i;
        } else if (rest + a[i] < cut) {
          rest += a[i];
        } else {
          flag = 0;
          break;
        }
      }
      if (flag) {
        puts("Yes");
        for (int i = 1; i <= k; i++) {
          if (i != 1) putchar(' ');
          printf("%d", num[i]);
          ;
        }
        puts("");
        ;
      } else {
        puts("No");
      }
    }
  }
  return 0;
}
