#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 750;
int as[MAX_N];
long long mbs[MAX_N + 1];
int check(int n, long long b) {
  priority_queue<long long> q;
  int c = 0;
  long long sum = b;
  for (int i = 0; i < n; i++) {
    sum += as[i];
    if (as[i] < 0) q.push(-as[i]);
    while (sum < 0) {
      sum += q.top();
      q.pop();
      c++;
    }
  }
  return c;
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  int k = 0;
  long long bsum = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", as + i);
    if (as[i] < 0) k++, bsum += -as[i];
  }
  for (int c = 0; c <= k; c++) {
    long long b0 = -1, b1 = bsum;
    while (b0 + 1 < b1) {
      long long b = (b0 + b1) / 2;
      if (check(n, b) <= c)
        b1 = b;
      else
        b0 = b;
    }
    mbs[k - c] = b1;
  }
  while (m--) {
    long long b;
    scanf("%lld", &b);
    int c = upper_bound(mbs, mbs + k + 1, b) - mbs;
    printf("%d\n", k + 1 - c);
  }
  return 0;
}
