#include <bits/stdc++.h>
using namespace std;
const int N = (int)2e6 + 10;
long long n, q;
long long a[N], f[N], d[N], z[N];
inline int F(const int &x) {
  if (f[f[x]] != f[x]) {
    int t = f[x];
    f[x] = F(t);
    d[x] += d[t];
  }
  return f[x];
}
inline void Merge(int a, int b) {
  f[a] = b;
  d[a] = 1;
}
int solve(long long b) {
  long long ans = (int)1e9;
  if (a[n - 1] <= b) return 1;
  for (int i(0); (i) < (int)(n + n + 1); i++) f[i] = i, d[i] = 0;
  int nxt = 0;
  for (int i(0); (i) < (int)(n + n); i++) {
    if (i)
      while (nxt < n + n && a[nxt] - a[i - 1] <= b) nxt++;
    else
      while (nxt < n + n && a[nxt] <= b) nxt++;
    z[i] = nxt;
  }
  for (int i(0); (i) < (int)(n); i++) {
    while (F(i) < n + i) Merge(f[i], z[f[i]]);
    ans = min(ans, d[i]);
  }
  return ans;
}
inline void read(long long &x) {
  char c = getchar();
  x = 0;
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
}
int main() {
  read(n);
  read(q);
  long long x;
  for (int i(0); (i) < (int)(n); i++) read(x), a[i] = a[i + n] = x;
  for (int i(0); (i) < (int)(n + n); i++)
    if (i) a[i] += a[i - 1];
  for (int i(0); (i) < (int)(q); i++) {
    long long x;
    read(x);
    cout << solve(x) << endl;
  }
  return 0;
}
