#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int main() {
  int n, block, x;
  long long sum = 0;
  int v[maxn], ans[maxn];
  bool flag = true;
  scanf("%d %d", &n, &block);
  for (int i = 0; i < n; i++) {
    scanf("%d", &v[i]);
    sum += v[i];
  }
  if (sum % block != 0) {
    flag = false;
  } else {
    long long each = sum / block, curSum = 0;
    int i = 0;
    int tag = 0;
    while (i < n && tag < block) {
      curSum = 0;
      int st = i;
      while (i < n && curSum < each) curSum += v[i++];
      if (curSum != each) {
        flag = false;
        break;
      }
      ans[tag++] = i - st;
    }
  }
  if (flag) {
    printf("Yes\n");
    for (int i = 0; i < block; i++) {
      printf("%d ", ans[i]);
    }
  } else
    printf("No\n");
  return 0;
}
