#include <bits/stdc++.h>
using namespace std;
int a[2000005];
vector<int> v;
long long b[1000005];
int main() {
  int n, Q;
  scanf("%d%d", &n, &Q);
  long long sum = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    sum += a[i];
    a[n + i] = a[i];
  }
  double LastTime = clock() / (double)CLOCKS_PER_SEC;
  while (Q--) {
    long long limit;
    cin >> limit;
    if (sum <= limit) {
      printf("1\n");
      continue;
    }
    v.clear();
    v.push_back(1);
    long long tmp = 0;
    for (int i = 1; i <= n; i++) {
      tmp += a[i];
      if (tmp > limit) v.push_back(i), b[v.size() - 1] = tmp - a[i], tmp = a[i];
    }
    b[v.size()] = tmp;
    int ans = v.size();
    long long last = 0;
    for (int i = v.back(); i <= n; i++) last += a[i];
    while (last < limit) {
      double CurTime = clock() / (double)CLOCKS_PER_SEC;
      if (CurTime - LastTime > 0.5) {
        LastTime = CurTime;
        break;
      }
      long long last1 = last;
      long long surplus = 0;
      for (int i = 0; i < v.size() - 1; i++) {
        surplus = b[i + 1] + last1 - limit;
        last1 = 0;
        for (int j = v[i + 1] - 1;; j--) {
          if (last1 >= surplus) break;
          last1 += a[j];
        }
      }
      if (last1 <= 0) {
        ans--;
        break;
      }
      b[v.size()] += a[v.back() - 1];
      b[v.size() - 1] -= a[v.back() - 1];
      last = b[v.size()];
      v[v.size() - 1]--;
    }
    printf("%d\n", ans);
  }
  return 0;
}
