#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
inline istream& operator>>(istream& fin, pair<T1, T2>& pr) {
  fin >> pr.first >> pr.second;
  return fin;
}
template <class T0, class T1, class T2>
inline istream& operator>>(istream& fin, tuple<T0, T1, T2>& t) {
  fin >> get<0>(t) >> get<1>(t) >> get<2>(t);
  return fin;
}
template <class T>
inline istream& operator>>(istream& fin, vector<T>& a) {
  for (auto& u : a) fin >> u;
  return fin;
}
template <class T, size_t n>
inline istream& operator>>(istream& fin, array<T, n>& a) {
  for (auto& u : a) fin >> u;
  return fin;
}
template <class FwdIter>
inline auto dump(FwdIter first, FwdIter last, const char* dlm) -> void {
  copy(first, last,
       ostream_iterator<typename iterator_traits<FwdIter>::value_type>(cout,
                                                                       dlm));
}
size_t xsolve(const vector<int64_t>& a, const int64_t k) {
  static const size_t inf = numeric_limits<size_t>::max() >> 2;
  const auto size = a.size();
  const auto n = size >> 1;
  size_t fst = 0, lst = inf, out = inf;
  vector<size_t> next(size + n);
  for (size_t i = n, j = size - 1; i < n + 1; --i) {
    while (a[i] + k < a[j]) --j;
    next[i] = j;
    if (fst + j < lst + i) fst = i, lst = j;
  }
  for (size_t i = 1; i < n + 1; ++i) {
    next[i + n] = next[i] + n;
    next[i + 2 * n] = next[i] + 2 * n;
  };
  for (size_t r = fst; r < lst + 1; ++r) {
    size_t acc = 0;
    for (size_t i = r; i < r + n && acc < out; ++acc) i = next[i];
    out = min(out, acc);
  }
  return out;
}
void e526() {
  size_t n, q;
  cin >> n >> q;
  vector<int64_t> a(n), query(q);
  cin >> a >> query;
  const auto size = 1 + 2 * n;
  vector<int64_t> xs(size);
  for (size_t i = 0; i < n; ++i) xs[i + 1] = xs[n + i + 1] = a[i];
  partial_sum(begin(xs), end(xs), begin(xs));
  for (const auto k : query) cout << xsolve(xs, k) << '\n';
}
int main(const int argc, char* argv[]) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  e526();
  return EXIT_SUCCESS;
}
