#include <bits/stdc++.h>
using namespace std;
struct info {
  long long b;
  int idx;
  info() {}
  bool operator<(const info &i) const {
    if (b != i.b) return b < i.b;
    return idx < i.idx;
  }
} Q[200005];
int n, m, A[1000];
int ans[200005];
void solve(int idL, int idR, int cntL, int cntR) {
  if (idL > idR) return;
  if (cntL == cntR) {
    for (int i = idL; i <= idR; i++) {
      ans[Q[i].idx] = cntL;
    }
    return;
  }
  multiset<int> s;
  int mid = (idL + idR) / 2;
  long long sum = Q[mid].b;
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    sum += A[i];
    if (A[i] < 0) s.insert(A[i]);
    if (sum < 0) {
      ++cnt;
      sum -= (*s.begin());
      s.erase(s.begin());
    }
  }
  ans[Q[mid].idx] = cnt;
  solve(idL, mid - 1, cnt, cntR);
  solve(mid + 1, idR, cntL, cnt);
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &A[i]);
  }
  for (int i = 1; i <= m; i++) {
    scanf("%I64d", &Q[i].b);
    Q[i].idx = i;
  }
  sort(Q + 1, Q + m + 1);
  solve(1, m, 0, n);
  for (int i = 1; i <= m; i++) {
    printf("%d\n", ans[i]);
  }
}
