#include <bits/stdc++.h>
const int MAXX = 1000005;
const int maxInt = 2147483647;
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n, k;
  cin >> n >> k;
  long long int a[n];
  long long int sum = 0;
  for (long long int i = 0; i < n; ++i) {
    cin >> a[i];
    sum += a[i];
  }
  if (sum % k) {
    cout << "No" << '\n';
    return 0;
  }
  long long int cu = sum / k;
  long long int lok = 0;
  long long int cev = 0;
  long long int ans = 0;
  for (long long int i = 0; i < n; ++i) {
    lok += a[i];
    ++cev;
    if (lok == cu) {
      cev = 0;
      lok = 0;
      ++ans;
    }
  }
  if (ans < k) {
    cout << "No" << '\n';
    return 0;
  }
  cout << "Yes" << '\n';
  for (long long int i = 0; i < n; ++i) {
    lok += a[i];
    ++cev;
    if (lok == cu) {
      cout << cev << " ";
      cev = 0;
      lok = 0;
      ++ans;
    }
  }
  cout << '\n';
  return 0;
}
