#include <bits/stdc++.h>
const double eps = 1e-6;
using namespace std;
inline long long read() {
  char ch = getchar();
  long long s = 0, w = 1;
  while (ch < 48 || ch > 57) {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= 48 && ch <= 57) {
    s = (s << 1) + (s << 3) + (ch ^ 48);
    ch = getchar();
  }
  return s * w;
}
inline void write(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) write(x / 10);
  putchar(x % 10 + 48);
}
long long n, k, a[300005];
int main() {
  cin >> n >> k;
  long long sum = 0, minn = 2147483647;
  for (register long long i = 1; i <= n; i++)
    a[i] = read(), sum += a[i], minn = (a[i] < minn ? a[i] : minn);
  if (sum / k * k != sum) {
    return 0 * puts("No");
  } else {
    vector<long long> ans;
    long long temp = 0, tepcnt = 0;
    for (register long long i = 1; i <= n; i++) {
      temp += a[i], tepcnt++;
      if (temp == sum / k) {
        ans.push_back(tepcnt);
        temp = 0, tepcnt = 0;
      }
    }
    if (!ans.size()) {
      return 0 * puts("No");
    } else {
      cout << "Yes" << endl;
      for (auto it : ans) {
        cout << it << " ";
      }
    }
  }
  return 0;
}
