#include <bits/stdc++.h>
using namespace std;
int arr[100005];
int main() {
  int n, k;
  long long sum = 0;
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", arr + i);
    sum += arr[i];
  }
  if (sum % k) {
    printf("No\n");
  } else {
    vector<int> res;
    long long group = sum / k;
    long long cursum = 0;
    int num = 0;
    bool ok = true;
    for (int i = 0; i < n; i++) {
      if (cursum == group) {
        res.push_back(num);
        num = 0;
        cursum = 0;
      } else if (cursum > group) {
        ok = false;
        break;
      }
      cursum += arr[i];
      num++;
    }
    res.push_back(num);
    if (ok && cursum == group) {
      printf("Yes\n");
      for (int i = 0; i < res.size(); i++) {
        if (i) {
          printf(" ");
        }
        printf("%d", res[i]);
      }
    } else {
      printf("No\n");
    }
  }
}
