#include <bits/stdc++.h>
using namespace std;
int n, q;
int a[2000200], range[2000200];
long long s[2000200];
void init(void) {
  scanf("%d%d", &n, &q);
  for (int i = (1), _b = (n); i <= _b; i = i + 1) scanf("%d", &a[i]);
  for (int i = (1), _b = (n); i <= _b; i = i + 1) a[n + i] = a[i];
  for (int i = (1), _b = (2 * n); i <= _b; i = i + 1) s[i] = s[i - 1] + a[i];
}
int jump(int x) {
  int res = 0;
  int cur = x;
  while (cur < x + n) {
    res++;
    cur = range[cur] + 1;
  }
  return (res);
}
void answer(long long lim) {
  for (int i = (1), _b = (2 * n); i <= _b; i = i + 1)
    if (s[i] <= lim) range[1] = i;
  int j = range[1];
  for (int i = (2), _b = (2 * n); i <= _b; i = i + 1) {
    while (j < 2 * n && s[j + 1] - s[i - 1] <= lim) j++;
    range[i] = j;
  }
  int idMin = 1;
  int res = 2000200;
  for (int i = (1), _b = (n); i <= _b; i = i + 1)
    if (range[i] - i < range[idMin] - idMin) idMin = i;
  int L = idMin;
  int R = range[idMin];
  if (R <= n) {
    L += n;
    R += n;
  }
  for (int i = (L), _b = (R); i <= _b; i = i + 1)
    res = min(res, jump(i > n ? i - n : i));
  for (int i = (1), _b = (L); i <= _b; i = i + 1)
    if (range[i] == R) {
      res = min(res, jump(i > n ? i - n : i));
      break;
    }
  printf("%d\n", res);
}
void process(void) {
  for (int love = 0, _n = (q); love < _n; love = love + 1) {
    long long x;
    cin >> x;
    answer(x);
  }
}
int main(void) {
  init();
  process();
  return 0;
}
