#include <bits/stdc++.h>
struct buf {
  template <typename _nt>
  operator _nt() {
    register int c = getchar();
    register _nt x = 0;
    for (; !isdigit(c); c = getchar())
      ;
    for (; isdigit(c); c = getchar()) x = x * 10 - '0' + c;
    return x;
  }
} fio;
int n, m, q, i, j, k, l, r, p[(1000000 * 2) + 1], ans;
long long b, s[(1000000 * 2) + 1];
int main() {
  n = fio, q = fio, m = n << 1;
  for (i = 1; i <= n; ++i) s[i] = fio, s[i] += s[i - 1];
  for (i = 1; i <= n; ++i) s[i + n] = s[i] + s[n];
  while (q--) {
    b = fio;
    for (i = 0, j = 1; i < m; p[++i] = j)
      while (j <= m && s[j] - s[i] <= b) ++j;
    l = 1;
    for (i = 2; i <= n; ++i)
      if (p[l] - l > p[i] - i) l = i;
    r = (p[l] - 1) % n + 1;
    ans = n;
    for (i = l;; i = i < n ? i + 1 : 1) {
      for (j = i, k = 0; j < i + n; j = p[j], ++k)
        ;
      ans = std::min(ans, k);
      if (i == r) break;
    }
    printf("%d\n", ans);
  }
  return 0;
}
