#include <bits/stdc++.h>
using namespace std;
int toRight[2000000 + 5], n, pset[2000000 + 5], h[2000000 + 5];
long long s[2000000 + 5];
int findset(int x) { return (pset[x] == x ? x : pset[x] = findset(pset[x])); }
void solve(long long x) {
  int ptr = 1;
  for (int i = 1; i < 2 * n; i++) {
    while (ptr < 2 * n && s[ptr] - s[i - 1] <= x) ptr++;
    toRight[i] = ptr;
  }
  h[2 * n] = 1;
  for (int i = 2 * n - 1; i >= 1; i--) h[i] = h[toRight[i]] + 1;
  for (int i = 1; i <= 2 * n; i++) pset[i] = i;
  int ans = 1e9;
  for (int i = 1; i <= n; i++) {
    int x = i;
    while (true) {
      x = findset(x);
      if (x - i + 1 > n) break;
      pset[x] = toRight[x];
    }
    ans = min(ans, h[i] - h[x]);
  }
  printf("%d\n", ans);
}
int main() {
  int tc;
  scanf("%d %d", &n, &tc);
  for (int i = 1; i <= n; i++) scanf("%d", &s[i]);
  for (int i = n + 1; i < 2 * n; i++) s[i] = s[i - n];
  for (int i = 1; i < 2 * n; i++) s[i] += s[i - 1];
  while (tc > 0) {
    long long x;
    cin >> x;
    solve(x);
    tc--;
  }
}
