#include <bits/stdc++.h>
using namespace std;
const int N = 750;
const int M = 2e5;
const long long inf = 1e18;
long long a[N + 10], b[M + 10], ans[N + 10];
int n, m;
long long solve(long long x) {
  int ret = 0;
  long long sum = x;
  priority_queue<long long> pq;
  for (int i = 1; i <= n; i++) {
    pq.push(-a[i]);
    sum += a[i];
    while (sum < 0) {
      sum += pq.top();
      pq.pop();
      ret++;
    }
  }
  return ret;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", a + i);
  }
  for (int i = 1; i <= m; i++) {
    scanf("%lld", b + i);
  }
  for (int i = 0; i <= n; i++) {
    long long lo = 0, hi = 1e15;
    while (lo < hi) {
      long long mid = (lo + hi) / 2;
      if (solve(mid) <= i) {
        hi = mid;
      } else {
        lo = mid + 1;
      }
    }
    ans[i] = lo;
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 0; j <= n; j++) {
      if (ans[j] <= b[i]) {
        printf("%d\n", j);
        break;
      }
    }
  }
}
