#include <bits/stdc++.h>
using namespace std;
const int MAX = 2005;
const int MOD = 1000000007;
const int MAGIC = 3;
int n;
int a[MAX];
int solve(long long x) {
  long long st = x;
  priority_queue<int, vector<int>, greater<int> > pq;
  int ans = 0;
  long long sub = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] < 0) {
      pq.push(a[i]);
    }
    st += a[i];
    if (st - sub < 0) {
      sub += pq.top();
      pq.pop();
      ans++;
    }
  }
  return ans;
}
long long bs(int x) {
  long long lo = 0;
  long long hi = 1000000000000000;
  while (lo < hi) {
    long long mid = (lo + hi + 1) / 2;
    int ans = solve(mid);
    if (ans < x) {
      hi = mid - 1;
    } else {
      lo = mid;
    }
  }
  return lo;
}
long long minis[MAX];
int main() {
  int m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 0; i < n + 1; i++) {
    minis[i] = bs(i);
  }
  int st = solve(0);
  for (int i = 0; i < m; i++) {
    long long q;
    scanf("%lld", &q);
    for (int j = st; ~j; j--) {
      if (minis[j] >= q) {
        printf("%d\n", j);
        break;
      }
    }
  }
}
