#include <bits/stdc++.h>
using namespace std;
int N, M, K;
int v[1005];
long long bst[1005];
priority_queue<int, vector<int>, greater<int> > pq;
int solve(long long start) {
  while (!pq.empty()) pq.pop();
  long long mood = start;
  int ans = 0;
  for (int i = 1; i <= N; i++) {
    mood += v[i];
    pq.push(v[i]);
    if (mood < 0) {
      mood -= pq.top();
      pq.pop();
      ans++;
    }
  }
  return ans;
}
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 1; i <= N; i++) scanf("%d", &v[i]);
  int K = solve(0);
  for (int i = 0; i <= K; i++) {
    long long p = 0;
    long long u = (1e15);
    while (p <= u) {
      long long mij = p + (u - p) / 2;
      if (solve(mij) <= i) {
        bst[i] = mij;
        u = mij - 1;
      } else
        p = mij + 1;
    }
  }
  for (int i = 1; i <= M; i++) {
    long long x;
    scanf("%I64d", &x);
    int p = 0;
    int u = K;
    int ans = 0;
    while (p <= u) {
      int mij = p + (u - p) / 2;
      if (x >= bst[mij]) {
        ans = mij;
        u = mij - 1;
      } else
        p = mij + 1;
    }
    printf("%d\n", ans);
  }
  return 0;
}
