#include <bits/stdc++.h>
using namespace std;
vector<long long> sa;
vector<pair<int, long long> > d;
int solve(int n, vector<long long> &a, long long b) {
  int res = n;
  for (int i = 0; i < n; ++i) {
    long long sum = sa[i + 1];
    sum -= b;
    int i1 = lower_bound(sa.begin(), sa.begin() + i, sum) - sa.begin();
    if (0 < i1) {
      d[i].first = d[i1 - 1].first + 1;
      d[i].second = d[i1 - 1].second;
    } else {
      d[i].first = 0;
      d[i].second = sa[i + 1];
    }
    if (sa.back() - sa[i + 1] + d[i].second <= b)
      res = min(res, d[i].first + 1);
  }
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  int n, q;
  cin >> n >> q;
  vector<long long> a(n);
  sa.push_back(0);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    sa.push_back(sa.back() + a[i]);
  }
  d.resize(n);
  for (int i = 0; i < q; ++i) {
    long long b;
    cin >> b;
    int res = solve(n, a, b);
    cout << res << "\n";
  }
  return 0;
}
