#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  int flag = 0;
  int tot = 0, sum = 0;
  int a[100005];
  int t[100005];
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    sum += a[i];
  }
  if (sum % k != 0)
    flag = 1;
  else {
    int kk = sum / k;
    int ans = 0, cnt = 0;
    for (int i = 1; i <= n; i++) {
      ans += a[i];
      cnt++;
      if (ans == kk) {
        t[++tot] = cnt;
        cnt = 0;
        ans = 0;
        continue;
      }
      if (ans > kk) {
        flag = 1;
        break;
      }
      if (i == n) {
        flag = 1;
      }
    }
  }
  if (flag == 1 || tot != k)
    printf("No\n");
  else {
    printf("Yes\n");
    for (int i = 1; i <= tot; i++) {
      if (i != tot)
        printf("%d ", t[i]);
      else
        printf("%d", t[tot]);
    }
  }
  return 0;
}
