#include <bits/stdc++.h>
const int N = 2000002;
int a[N], fast[N];
long long sum[N];
int prepare(long long d, int n) {
  if (d >= sum[n]) return 1;
  for (int i = 1, j = 1; i <= n;) {
    if (sum[j] - sum[i - 1] > d) {
      fast[i] = j;
      i++;
    } else
      j++;
  }
  for (int i = 1; i <= n; i++) fast[i + n] = fast[i] + n;
  int best = 1;
  for (int i = 1; i <= n; i++)
    if (fast[i] - i < fast[best] - best) best = i;
  int ret = n;
  for (int i = best; i <= fast[best]; i++) {
    int num = 0, start = i;
    if (start > n) start -= n;
    for (int j = start; j < start + n; j = fast[j]) {
      num++;
    }
    ret = std::min(ret, num);
  }
  return ret;
}
int main() {
  int n, q;
  scanf("%d%d", &n, &q);
  for (int i = 0; i < n; i++) scanf("%d", a + i), a[n + i] = a[i];
  for (int i = 1; i <= n * 2; i++) sum[i] = sum[i - 1] + a[i - 1];
  for (int i = 0; i < q; i++) {
    long long d;
    scanf("%I64d", &d);
    printf("%d\n", prepare(d, n));
  }
  return 0;
}
