#include <bits/stdc++.h>
using namespace std;
int n, m;
int pos[300000];
long long a[1000];
long long b[300000];
long long x[1000];
int check(long long mood) {
  int cnt = 0;
  map<long long, int> mp;
  for (int i = 0; i < n; i++) {
    mood += a[i];
    mp[a[i]]++;
    if (mood < 0) {
      cnt++;
      mood -= (*mp.begin()).first;
      (*mp.begin()).second--;
      if ((*mp.begin()).second == 0) mp.erase(mp.begin());
    }
  }
  return cnt;
}
bool comp(int i, int j) { return b[i] < b[j]; }
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) {
    cin >> b[i];
    pos[i] = i;
  }
  sort(pos, pos + m, comp);
  pos[m] = m;
  b[m] = 1000000000000000000;
  for (int i = 0; i <= n; i++) {
    int l = 0, r = m;
    int mid = l;
    if (i) r = x[i - 1];
    while (r - l > 1) {
      mid = (l + r) / 2;
      if (check(b[pos[mid]]) <= i)
        r = mid;
      else
        l = mid;
    }
    if (check(b[pos[l]]) <= i)
      x[i] = l;
    else
      x[i] = r;
  }
  for (int j = 0; j <= n; j++) x[j] = b[pos[x[j]]];
  for (int i = 0; i < m; i++) {
    for (int j = 0; j <= n; j++) {
      if (x[j] <= b[i]) {
        cout << j << endl;
        break;
      }
    }
  }
}
