#include <bits/stdc++.h>
using namespace std;
int N, M;
long long A[755], cap[750];
int check(long long val) {
  priority_queue<long long, vector<long long>, greater<long long>> pq;
  long long sum = val;
  int cnt = 0;
  for (int i = 1; i <= N; i++) {
    pq.push(A[i]);
    sum += A[i];
    while (sum < 0) {
      sum -= pq.top();
      cnt++;
      pq.pop();
    }
  }
  return cnt;
}
int32_t main() {
  scanf("%d %d", &N, &M);
  for (int i = 1; i <= N; i++) {
    scanf("%lld", &A[i]);
  }
  long long l, r, res = 750000000000, mid;
  for (int i = 0; i <= N; i++) {
    l = 0, r = res;
    while (l <= r) {
      mid = (l + r) >> 1;
      if (check(mid) <= i) {
        r = mid - 1;
        res = mid;
      } else
        l = mid + 1;
    }
    cap[i] = res;
  }
  long long Q;
  while (M--) {
    scanf("%lld", &Q);
    l = 0, r = N;
    while (l <= r) {
      mid = (l + r) >> 1;
      if (cap[mid] <= Q) {
        r = mid - 1;
        res = mid;
      } else
        l = mid + 1;
    }
    printf("%lld\n", res);
  }
  cin >> N;
}
