#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
long long b[N], a[N], c[N];
int n, m, ans[N];
int getDeletes(long long mood) {
  int res = 0;
  priority_queue<int> P;
  for (int i = 0; i < n; ++i) {
    mood += a[i];
    if (a[i] < 0) P.push(-a[i]);
    if (mood < 0) {
      ++res;
      mood += P.top();
      P.pop();
    }
  }
  return res;
}
void solve(int L, int R, int l, int r) {
  if (L > R || l > r) return;
  if (l == r) {
    for (int i = L; i <= R; ++i) {
      ans[i] = l;
    }
    return;
  }
  if (L == R) {
    if (ans[L] == -1) ans[L] = getDeletes(b[L]);
    return;
  }
  int M = (L + R) / 2;
  if (ans[M] == -1) ans[M] = getDeletes(b[M]);
  solve(L, M - 1, ans[M], r);
  solve(M + 1, R, l, ans[M]);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  for (int i = 0; i < m; ++i) {
    ans[i] = -1;
    cin >> b[i];
    c[i] = b[i];
  }
  sort(b, b + m);
  solve(0, m - 1, 0, n);
  for (int i = 0; i < m; ++i) {
    int pos = lower_bound(b, b + m, c[i]) - b;
    cout << ans[pos] << "\n";
  }
  return 0;
}
