#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
int n, a[755], m, sol[N];
vector<pair<long long, int> > v;
int check(long long x) {
  priority_queue<long long> q;
  int ret = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] < 0) q.push(a[i] * -1);
    x += a[i];
    while (x < 0) {
      ret++;
      x += q.top();
      q.pop();
    }
  }
  return ret;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int i = 0; i < m; i++) {
    long long a;
    scanf("%I64d", &a);
    v.push_back(pair<long long, int>(a, i));
  }
  sort(v.begin(), v.end());
  int idx = m - 1;
  for (int i = 0; i <= n; i++) {
    long long low = 0, high = 1e15;
    while (low < high) {
      long long mid = (low + high) / 2;
      if (check(mid) > i)
        low = mid + 1;
      else
        high = mid;
    }
    while (idx >= 0) {
      if (v[idx].first >= low) {
        sol[v[idx].second] = i;
        idx--;
      } else
        break;
    }
  }
  for (int i = 0; i < m; i++) printf("%d\n", sol[i]);
  return 0;
}
