#include <bits/stdc++.h>
using namespace std;
int a[1000100], n, m;
int sum[1000100], now;
long long ans;
int idx, cnt;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), ans += a[i];
  if (ans % m) {
    puts("No");
    return 0;
  }
  ans /= m;
  for (int i = 1; i <= n; i++) {
    cnt += a[i], now++;
    if (cnt == ans) {
      sum[++idx] = now;
      now = 0, cnt = 0;
    } else if (cnt > ans) {
      puts("No");
      return 0;
    }
  }
  puts("Yes");
  for (int i = 1; i <= idx; i++) printf("%d ", sum[i]);
  return 0;
}
