#include <bits/stdc++.h>
using namespace std;
const int MAXN = (1 << 10);
const int64_t inf = (int64_t)1e15 + 42;
int n, m;
int a[MAXN];
void read() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> a[i];
}
int64_t ans[MAXN];
priority_queue<int> pq;
bool check(int64_t val, int cnt) {
  while (!pq.empty()) pq.pop();
  int ret = 0;
  int64_t mx = val;
  for (int i = 1; i <= n; i++) {
    pq.push(-a[i]);
    if (mx + a[i] < 0) {
      mx += pq.top();
      pq.pop();
      ret++;
    }
    mx += a[i];
  }
  return ret <= cnt;
}
void solve() {
  for (int i = 0; i <= n; i++) {
    int64_t low = 0, high = inf, mid;
    while (low <= high) {
      mid = (low + high) >> 1ll;
      if (check(mid, i))
        high = mid - 1, ans[i] = mid;
      else
        low = mid + 1;
    }
  }
  for (int i = 1; i <= m; i++) {
    int64_t val;
    cin >> val;
    int low = 0, high = n, mid, ret;
    while (low <= high) {
      mid = (low + high) >> 1;
      if (val >= ans[mid])
        ret = mid, high = mid - 1;
      else
        low = mid + 1;
    }
    cout << ret << '\n';
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  read();
  solve();
  return 0;
}
