#include <bits/stdc++.h>
using namespace std;
long long getint() {
  long long summ = 0, f = 1;
  char ch;
  for (ch = getchar(); !isdigit(ch) && ch != '-'; ch = getchar())
    ;
  if (ch == '-') {
    f = -1;
    ch = getchar();
  }
  for (; isdigit(ch); ch = getchar())
    summ = (summ << 3) + (summ << 1) + ch - 48;
  return summ * f;
}
long long n, m, a[200005], ans, k, s[200004];
priority_queue<long long> q;
signed main() {
  cin >> n >> m;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  for (long long i = n; i; i--) {
    if (a[i] < 0)
      q.push(a[i]);
    else {
      while (!q.empty() && a[i] >= 0) {
        a[i] += q.top();
        q.pop();
      }
      if (a[i] < 0) q.push(a[i]);
    }
  }
  long long tot = 0;
  while (!q.empty()) {
    s[++tot] = q.top();
    q.pop();
  }
  for (long long i = 1; i <= tot; i++) {
    s[i] = -s[i] + s[i - 1];
  }
  for (long long i = 1, x; i <= m; i++) {
    x = getint();
    cout << tot + 1 - (upper_bound(s + 1, s + 1 + tot, x) - s) << endl;
  }
  return 0;
}
