#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
const int P = 1000000007;
const long long mod = P;
const int INF = 0x3f3f3f3f;
const long long LLINF = 0x3f3f3f3f3f3f3f3f;
const long double eps = 1e-8;
long long qmod(long long a, long long n, long long mod) {
  long long ans = 1;
  while (n) {
    assert(ans > 0);
    if (n & 1ll) ans = ans * a % mod;
    n >>= 1;
    a = a * a % mod;
  }
  return ans % mod;
}
int a[N];
int main() {
  int n, k;
  cin >> n >> k;
  long long sum = 0;
  for (int i = 1; i <= n; ++i) cin >> a[i], sum += a[i];
  if (sum % k) return 0 * printf("No\n");
  vector<int> ans;
  int goal = sum / k, now = 0, cnt = 0;
  for (int i = 1; i <= n; ++i) {
    now += a[i];
    ++cnt;
    if (now == goal) ans.push_back(cnt), now = 0, cnt = 0;
  }
  if (ans.size() != k) return 0 * printf("No\n");
  printf("Yes\n");
  for (auto &x : ans) cout << x << " ";
  return 0;
}
