#include <bits/stdc++.h>
using namespace std;
int n, m, da[1000];
long long int gus[214 * 1024];
void read_dat() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> da[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> gus[i];
  }
}
int calc_to_del(long long int su, const int expected) {
  priority_queue<int, vector<int>, greater<int>> q;
  int ret = 0;
  for (int i = 0; i < n; i++) {
    if (da[i] < 0) {
      q.push(da[i]);
    }
    su += da[i];
    if (su < 0) {
      ++ret;
      if (expected < ret) return ret;
      const auto to = q.top();
      q.pop();
      su -= to;
    }
  }
  return ret;
}
vector<pair<long long, int>> calc_bests() {
  vector<pair<long long, int>> ret;
  const auto del0 = calc_to_del(0, n);
  {
    if (0 == del0) return {};
    ret.push_back(make_pair(0, del0));
  }
  {
    for (int to_del = del0 - 1; 0 <= to_del; --to_del) {
      long long lo = 0, hi = 1000ll * 1000ll * 1000ll * 1000ll;
      do {
        auto mid_su = lo + ((hi - lo) >> 1);
        const auto actual = calc_to_del(mid_su, to_del);
        if (actual <= to_del) {
          hi = mid_su - 1;
        } else {
          lo = mid_su + 1;
        }
      } while (lo < hi);
      const auto actual = calc_to_del(lo, to_del);
      if (actual != to_del) {
        ++lo;
      }
      ret.push_back(make_pair(lo, to_del));
    }
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  read_dat();
  const auto bes = calc_bests();
  for (int i = 0; i < m; i++) {
    auto it = lower_bound(bes.begin(), bes.end(), make_pair(gus[i], 0));
    int ans;
    if (bes.end() == it) {
      ans = 0;
    } else {
      ans = it->second;
      if (bes.begin() != it && gus[i] < it->first) {
        --it;
        if (it->first <= gus[i]) ans = it->second;
      }
    }
    cout << ans << '\n';
  }
  return 0;
}
