#include <bits/stdc++.h>
using namespace std;
const int N = 2e6;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k, i, sum = 0, cnt = 0, flag = 1, tmp = 0, avg;
  cin >> n >> k;
  int a[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  for (int i = 0; i < n; ++i) {
    sum += a[i];
  }
  if (sum % k != 0) {
    cout << "No"
         << "\n";
    return 0;
  } else {
    vector<int> v;
    avg = sum / k;
    for (int i = 0; i < n; ++i) {
      tmp += a[i];
      cnt++;
      if (tmp == avg) {
        v.push_back(cnt);
        tmp = 0;
        cnt = 0;
      } else if (tmp > avg) {
        flag = 0;
        break;
      }
    }
    if (flag == 1) {
      cout << "Yes"
           << "\n";
      for (int i = 0; i < v.size(); ++i) {
        cout << v[i] << " ";
      }
    } else {
      cout << "No"
           << "\n";
    }
  }
}
