#include <bits/stdc++.h>
using namespace std;
long long int n, m, a[200007], b[200007], mins[200007];
bool check(long long int x, long long int q) {
  long long int res = 0, cur = q;
  multiset<long long int> s;
  for (long long int i = 0; i < n; ++i) {
    cur += a[i];
    s.insert(a[i]);
    while (cur < 0) {
      cur -= *s.begin();
      s.erase(s.begin());
      res++;
    }
  }
  return res <= x;
}
vector<long long int> v;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (long long int i = 0; i < n; ++i) cin >> a[i];
  for (long long int i = 0; i < m; ++i) cin >> b[i], v.push_back(b[i]);
  sort(v.begin(), v.end());
  v.push_back(0x3f3f3f3f3f3f3f3f);
  for (long long int i = 0; i <= n; ++i) {
    long long int l = 0, r = m, ans = m;
    while (l < r) {
      long long int mid = (l + r) / 2;
      if (check(i, v[mid])) {
        ans = mid;
        r = mid;
      } else
        l = mid + 1;
    }
    mins[i] = ans;
  }
  for (long long int i = 0; i < m; ++i) {
    long long int res = 0;
    long long int l = 0, r = n + 1;
    while (l < r) {
      long long int mid = (l + r) / 2;
      if (v[mins[mid]] <= b[i]) {
        res = mid;
        r = mid;
      } else
        l = mid + 1;
    }
    cout << res << '\n';
  }
  return 0;
}
