#include <bits/stdc++.h>
const int N = 100005;
int a[N], b[N], cnt;
int read() {
  int x = 0;
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  while (c >= '0' && c <= '9')
    x = (x << 3) + (x << 1) + (c ^ 48), c = getchar();
  return x;
}
int main() {
  int n = read(), m = read(), sum = 0;
  for (int i = 1; i <= n; ++i) a[i] = read(), sum += a[i];
  if (sum % m)
    puts("No");
  else {
    int k = sum / m, sum = 0;
    for (int i = 1; i <= n; ++i) {
      sum += a[i];
      if (sum > k) break;
      if (sum == k) b[++cnt] = i, sum = 0;
    }
    if (cnt < m)
      puts("No");
    else {
      puts("Yes");
      for (int i = 1; i <= cnt; ++i) printf("%d ", b[i] - b[i - 1]);
    }
  }
  return 0;
}
