#include <bits/stdc++.h>
using namespace std;
long long n, m;
long long a[760];
long long ans[760];
bool check(long long b, long long mx) {
  long long ps = 0, s = 0, cnt = 0;
  priority_queue<long long, vector<long long>, greater<long long>> pq;
  for (long long j = 1; j <= n; ++j) {
    pq.push(a[j]);
    ps += a[j];
    while (ps + b < 0) {
      ps -= pq.top();
      pq.pop();
      ++cnt;
    }
  }
  return cnt <= mx;
}
int main() {
  scanf("%lld %lld", &n, &m);
  for (long long i = 1; i <= n; ++i) scanf("%lld", &a[i]);
  for (long long i = 0; i <= n; ++i) {
    long long l = 0, r = (long long)(1e16), cc = (long long)(1e16);
    while (l <= r) {
      long long mid = (l + r) / 2;
      if (check(mid, i)) {
        r = mid - 1;
        cc = min(cc, mid);
      } else
        l = mid + 1;
    }
    ans[i] = cc;
  }
  for (long long i = 1; i <= m; ++i) {
    long long b;
    scanf("%lld", &b);
    for (long long j = 0; j <= n; ++j) {
      if (ans[j] <= b) {
        printf("%lld\n", j);
        break;
      }
    }
  }
  return 0;
}
