#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream& operator<<(ostream& o, vector<T>& v) {
  for (auto& x : v) o << x << ' ';
  return o;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<int> arr(n);
  for (int i = 0; i < n; i++) cin >> arr[i];
  vector<long long> ans;
  for (int need = 0;; need++) {
    long long lo = 0, hi = 1e16;
    while (lo < hi) {
      long long mid = (lo + hi) / 2;
      int res = 0;
      priority_queue<int, vector<int>, greater<int>> pq;
      long long cur = mid;
      for (int i = 0; i < n; i++) {
        cur += arr[i];
        if (arr[i] < 0) pq.push(arr[i]);
        while (cur < 0) {
          cur -= pq.top();
          pq.pop();
          res++;
        }
      }
      if (res > need)
        lo = mid + 1;
      else
        hi = mid;
    }
    if (lo == 0) break;
    ans.push_back(-lo);
  }
  while (m--) {
    long long x;
    cin >> x;
    int id = lower_bound(ans.begin(), ans.end(), -x) - ans.begin();
    cout << id << endl;
  }
}
