#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  long long sum = 0;
  long long arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    sum += arr[i];
  }
  long long tito = sum / k;
  if (tito * k != sum) {
    cout << "No" << endl;
  } else {
    long long cur = 0;
    int wina = 0;
    vector<int> answer;
    bool gamovida = true;
    for (int i = 0; i <= n; i++) {
      if (cur == tito) {
        answer.push_back(i - wina);
        wina = i;
        cur = 0;
      }
      if (i == n) {
        break;
      }
      cur += arr[i];
      if (cur > tito) {
        gamovida = false;
        break;
      }
    }
    if (!gamovida) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
      for (int i = 0; i < answer.size(); i++) {
        cout << answer[i] << " ";
      }
      cout << endl;
    }
  }
  return 0;
}
