#include <bits/stdc++.h>
using namespace std;
int n, m, ans;
long long a[755], start, rest[755], rst;
priority_queue<long long> heap;
inline void dixiao(long long x) {
  long long tmp = 0;
  while (x > 0 && heap.empty() == false) {
    tmp = heap.top();
    heap.pop();
    x += tmp;
  }
  if (x < 0) {
    heap.push(x);
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (register int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
  }
  for (register int i = n; i >= 1; i--) {
    switch (a[i] > 0) {
      case true:
        dixiao(a[i]);
        break;
      case false:
        heap.push(a[i]);
        break;
    }
  }
  while (heap.empty() == false) {
    rst++;
    rest[rst] = heap.top();
    heap.pop();
  }
  for (register int i = 1; i <= m; i++) {
    scanf("%lld", &start);
    ans = 0;
    while (start + rest[ans + 1] >= 0 && ans < rst) {
      start += rest[ans + 1];
      ans++;
    }
    printf("%d\n", rst - ans);
  }
  return 0;
}
