#include <bits/stdc++.h>
using namespace std;
inline long long getnum() {
  char c = getchar();
  long long num, sign = 1;
  for (; c < '0' || c > '9'; c = getchar())
    if (c == '-') sign = -1;
  for (num = 0; c >= '0' && c <= '9';) {
    c -= '0';
    num = num * 10 + c;
    c = getchar();
  }
  return num * sign;
}
long long A[1000], B[1000], C[1000];
priority_queue<long long> PQ;
int main() {
  int n = getnum(), m = getnum();
  for (int i = 1; i <= n; i++) A[i] = getnum();
  for (int j = 0; j <= n; j++) {
    long long l = 0, r = 1e6 * 1e6;
    while (l < r) {
      long long x = (l + r) / 2;
      long long sum = x, tot = 0;
      for (int i = 1; i <= n; i++) {
        if (A[i] < 0) PQ.push(-A[i]);
        sum += A[i];
        while (sum < 0) {
          tot++;
          sum += PQ.top();
          PQ.pop();
        }
      }
      while (PQ.size()) PQ.pop();
      if (tot <= j)
        r = x;
      else
        l = x + 1;
    }
    B[j] = r;
  }
  for (int i = 1; i <= m; i++) {
    long long x = getnum();
    int l = lower_bound(B, B + n + 1, x, greater<long long>()) - B;
    printf("%d\n", l);
  }
}
