#include <bits/stdc++.h>
int n, q;
int to[2000005];
long long a[2000005];
void solve(long long b) {
  long long sum = 0LL;
  for (int i = 2 * n - 1, j = 2 * n; i >= 0; i--) {
    sum += a[i];
    while (sum > b) sum -= a[--j];
    to[i] = j;
  }
  int good = 0;
  for (int i = 0; i < n; i++)
    if (to[i] - i < to[good] - good) good = i;
  int ret = n;
  for (int i = good; i <= to[good]; i++) {
    int start = i;
    if (start >= n) start -= n;
    int pos = start;
    int cnt = 0;
    while (pos < start + n) {
      pos = to[pos];
      cnt++;
    }
    ret = (ret < cnt ? ret : cnt);
  }
  printf("%d\n", ret);
}
int main() {
  long long b;
  scanf("%d%d", &n, &q);
  for (int i = 0; i < n; i++) scanf("%I64d", &a[i]);
  memcpy(a + n, a, n << 4);
  while (q--) {
    scanf("%I64d", &b);
    solve(b);
  }
  return 0;
}
