#include <bits/stdc++.h>
const int Inf = 1e9;
long long LINF = (long long)4e18;
using namespace std;
long long mod = 1e9 + 7;
long long mod2 = 1e9 + 123;
void die() {
  cout << "No";
  exit(0);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  int sum = 0;
  for (int(i) = 0; (i) < n; (i)++) {
    cin >> a[i];
    sum += a[i];
  }
  if (sum % k != 0) die();
  sum /= k;
  int cur = 0;
  vector<int> ans;
  int cursum = 0;
  for (int(i) = 0; (i) < n; (i)++) {
    cursum += a[i];
    if (cursum == sum) {
      ans.push_back(cur + 1);
      cur = 0;
      cursum = 0;
    } else {
      if (cursum > sum) die();
      cur++;
    }
  }
  cout << "Yes\n";
  for (int(i) = 0; (i) < ans.size(); (i)++) cout << ans[i] << " ";
  return 0;
}
