#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int N = 2e5 + 42;
long long need[N];
int a[N], ans[N];
long long n, m;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i <= n; i++) {
    long long l = 0, r = 1e15;
    if (i) r = need[i - 1];
    while (l < r) {
      long long mid = (l + r) / 2;
      int am = 0;
      long long csum = 0;
      multiset<int> cur;
      for (int j = 0; j < n; j++) {
        csum += a[j];
        cur.insert(a[j]);
        while (csum + mid < 0) {
          csum -= *cur.begin();
          cur.erase(cur.begin());
          am++;
        }
      }
      if (am <= i)
        r = mid;
      else
        l = mid + 1;
    }
    need[i] = l;
  }
  vector<pair<long long, long long> > q(m);
  for (int i = 0; i < m; i++) {
    cin >> q[i].first;
    q[i].second = i;
  }
  sort((q).rbegin(), (q).rend());
  int cpos = 0;
  for (int i = 0; i < m; i++) {
    while (q[i].first < need[cpos]) cpos++;
    ans[q[i].second] = cpos;
  }
  for (int i = 0; i < m; i++) printf("%lld\n", ans[i]);
  return 0;
}
