#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  vector<int> a(n);
  vector<long long> b(m);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int i = 0; i < m; i++) scanf("%lld", &b[i]);
  vector<long long> c = b;
  sort(c.begin(), c.end());
  multiset<int> s;
  vector<long long> x(n + 1);
  for (int i = 0; i <= n; i++) {
    int l = 0, r = m;
    int mid, p;
    long long sum;
    bool f;
    while (r - l > 0) {
      mid = (l + r) / 2;
      sum = c[mid];
      p = 0;
      f = false;
      s.clear();
      for (int j = 0; j < n; j++) {
        s.insert(a[j]);
        sum += a[j];
        if (sum < 0) {
          while (!s.empty() && sum < 0) {
            p++;
            sum -= *(s.begin());
            s.erase(s.begin());
          }
        }
        if (p > i || sum < 0) {
          f = true;
          break;
        }
      }
      if (f)
        l = mid + 1;
      else
        r = mid;
    }
    if (r == m)
      x[i] = 1000000000000001;
    else
      x[i] = c[r];
  }
  for (int i = 0; i < m; i++) {
    for (int j = 0; j <= n; j++) {
      if (b[i] >= x[j]) {
        printf("%d\n", j);
        break;
      }
    }
  }
  return 0;
}
