#include <bits/stdc++.h>
using namespace std;
long long sum[2000005];
int nxt[2000005];
void solve() {
  int n;
  int q;
  cin >> n >> q;
  for (int i = 0; i < n; ++i) scanf("%d", sum + i);
  memcpy(sum + n, sum, n * sizeof(long long));
  for (int i = 1; i <= 2 * n - 1; ++i) {
    sum[i] += sum[i - 1];
  }
  for (int i = 2 * n; i > 0; --i) sum[i] = sum[i - 1];
  sum[0] = 0;
  for (int t = 0; t < q; ++t) {
    int b;
    cin >> b;
    int lf, rg, minn = n;
    for (int i = 0; i < n; ++i) {
      int idx = upper_bound(sum, sum + 2 * n, b + sum[i]) - sum - 1;
      nxt[i] = min(n, idx - i);
      if (minn > nxt[i]) {
        minn = nxt[i];
        lf = i;
        rg = nxt[i] + i;
      }
    }
    if (minn == n) {
      cout << 1 << endl;
      continue;
    }
    int S = n;
    for (int from = lf; from <= rg; ++from) {
      int cnt = 0;
      int now = from;
      for (int i = 1; i <= n; ++i) {
        cnt += nxt[now];
        now = (now + nxt[now]) % n;
        if (cnt >= n) {
          S = min(S, i);
          break;
        }
      }
    }
    cout << S << endl;
  }
}
int main() {
  solve();
  return 0;
}
