#include <bits/stdc++.h>
const int N = 1e6 + 7;
long long a[N], f[N], yks[N];
int n, q;
template <class T>
void G(T &num) {
  static char a;
  static bool fl;
  for (a = getchar(), fl = false; a > '9' || a < '0'; a = getchar())
    if (a == '-') fl = true;
  for (num = 0; a >= '0' && a <= '9'; a = getchar())
    num = (num << 3) + (num << 1) + a - '0';
  if (fl) num = -num;
}
void Min(long long &x, long long y) {
  if (x > y) x = y;
}
long long solve(long long k) {
  long long ans = 0x3f3f3f3f3f3f3f3f;
  int p1 = 0, p2;
  for (p2 = 1; a[p2] < k; ++p2) f[p2] = 0, yks[p2] = a[p2];
  for (; p2 <= n; ++p2) {
    while (a[p2] - a[p1] > k) ++p1;
    f[p2] = f[p1] + 1;
    yks[p2] = yks[p1];
  }
  for (int i = 1; i <= n; ++i)
    if (yks[i] + a[n] - a[i] <= k) Min(ans, f[i] + 1);
  return ans;
}
int main() {
  G(n), G(q);
  for (int i = 1; i <= n; ++i) G(a[i]), a[i] += a[i - 1];
  long long k;
  while (q--) {
    G(k);
    printf("%I64d\n", solve(k));
  }
  return 0;
}
