#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
int n, m;
long long a[MAXN];
pair<long long, int> b[MAXN];
long long answer[MAXN];
int calc(long long x) {
  int cnt = 0;
  priority_queue<long long> q;
  for (int i = 0; i < n; i++) {
    q.push(-a[i]);
    x += a[i];
    while (x < 0) {
      x += q.top();
      cnt++;
      q.pop();
    }
  }
  return cnt;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> b[i].first;
    b[i].second = i;
  }
  sort(b, b + m);
  for (int i = 0; i < m;) {
    int iOld = i;
    int base = calc(b[i].first);
    int l, r, mid;
    l = i;
    r = m - 1;
    while (l + 1 < r) {
      mid = (l + r) / 2;
      if (calc(b[mid].first) == base)
        l = mid;
      else
        r = mid - 1;
    }
    if (calc(b[r].first) == base)
      i = r + 1;
    else
      i = l + 1;
    for (int j = iOld; j < i; j++) {
      answer[b[j].second] = base;
    }
  }
  for (int i = 0; i < m; i++) {
    cout << answer[i] << '\n';
  }
}
