#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e6 + 9;
set<int> ist;
map<string, int> msi;
map<string, string> mss;
map<int, string> mis;
map<int, int> mii;
pair<int, int> pii;
vector<int> v;
vector<pair<int, int> > vv;
int cc[] = {1, -1, 0, 0};
int rr[] = {0, 0, 1, -1};
int ahm[100009], sam[100009];
int BACKSLASH() {
  int n, m, cnt = 0, t, c = 0, cs = 1;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> ahm[i];
    cnt = cnt + ahm[i];
  }
  t = cnt / m;
  if (t * m != cnt) {
    cout << "No" << endl;
    return 0;
  }
  cnt = 0;
  for (int i = 1; i <= n; i++) {
    cnt = cnt + ahm[i];
    c++;
    if (cnt == t) {
      cnt = 0;
      sam[cs] = c;
      c = 0;
      cs++;
    } else if (cnt > t) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  for (int i = 1; i <= m; i++) {
    cout << sam[i] << ' ';
  }
  cout << endl;
  return 0;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  BACKSLASH();
  return 0;
}
