#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, k, sum = 0, c = 0;
  cin >> n >> k;
  int arr[n];
  for (long long int i = 0; i < n; i++) {
    cin >> arr[i];
    sum += arr[i];
  }
  if (sum % k != 0) {
    cout << "No\n";
    return 0;
  }
  int t = sum / k;
  sum = 0;
  vector<int> ele;
  for (long long int i = 0; i < n; i++) {
    sum += arr[i];
    c++;
    if (sum == t) {
      sum = 0;
      ele.push_back(c);
      c = 0;
    }
  }
  if (ele.size() == 0) {
    cout << "No\n";
    return 0;
  }
  cout << "Yes\n";
  for (auto it : ele) cout << it << " ";
  cout << endl;
  return 0;
}
