#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 800;
int n, m;
int a[MAX_N];
long long f[MAX_N];
priority_queue<int> s;
int solve(long long q) {
  int ans = 0, t, i;
  while (!s.empty()) s.pop();
  for (i = 1; i <= n; i++) {
    q += a[i];
    s.push(-a[i]);
    while (q < 0) {
      if (s.empty()) return (1 << 30);
      t = -s.top();
      s.pop();
      q -= t;
      ans++;
    }
  }
  return ans;
}
int main() {
  int i;
  long long l, r, mid;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (i = 0; i <= n; i++) {
    l = -(1LL << 60) - 2;
    r = (1LL << 60) + 2;
    while (r - l > 1) {
      mid = (l + r) >> 1;
      if (solve(mid) <= i)
        r = mid;
      else
        l = mid;
    }
    f[i] = r;
  }
  while (m--) {
    long long q;
    scanf("%lld", &q);
    l = -1;
    r = n + 1;
    while (r - l > 1) {
      mid = (l + r) >> 1;
      if (f[mid] <= q)
        r = mid;
      else
        l = mid;
    }
    printf("%lld\n", r);
  }
  return 0;
}
