#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[760];
long long b[760], dp[760];
priority_queue<int> pq;
bool judge(long long num, int left) {
  while (!pq.empty()) pq.pop();
  long long sum = num;
  for (int i = 0; i < n; i++) {
    sum += a[i];
    if (a[i] < 0) pq.push(-a[i]);
    while (sum < 0) {
      if (left == 0 || pq.empty()) return false;
      --left;
      sum += pq.top();
      pq.pop();
    }
  }
  return true;
}
void init() {
  long long sum = 0;
  long long min_sum = 0;
  for (int i = 0; i < n; i++) {
    sum += a[i];
    if (sum < min_sum) min_sum = sum;
  }
  for (int i = 0; i <= n; i++) {
    long long l = 0;
    long long r = -min_sum;
    while (l < r) {
      long long mid = (l + r) / 2;
      if (judge(mid, i))
        r = mid;
      else
        l = mid + 1;
    }
    dp[i] = r;
  }
}
int cal(long long q) {
  int l = 0;
  int r = n;
  while (l < r) {
    int mid = (l + r) / 2;
    if (q >= dp[mid])
      r = mid;
    else
      l = mid + 1;
  }
  return r;
}
int main() {
  while (scanf("%d%d", &n, &m) == 2) {
    for (int i = 0; i < n; i++) scanf("%d", a + i);
    init();
    long long q;
    while (m--) {
      cin >> q;
      printf("%d\n", cal(q));
    }
  }
  return 0;
}
