#include <bits/stdc++.h>
using namespace std;
int a[751];
long long int valorconrechazos[751];
int n, m;
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int last = 0;
  for (int i = n; i >= 1; i--) {
    int ai = a[i];
    if (ai > 0) {
      for (int j = 0; j <= last; j++) valorconrechazos[j] -= ai;
      last++;
      for (; last > 0 and valorconrechazos[last - 1] <= 0; last--)
        valorconrechazos[last - 1] = 0;
    } else {
      for (int j = last; j > 0; j--)
        valorconrechazos[j] =
            min(valorconrechazos[j] - ai, valorconrechazos[j - 1]);
      valorconrechazos[0] -= ai;
      last++;
    }
  }
  for (int i = 1; i <= m; i++) {
    long long int b;
    cin >> b;
    int inf = -1;
    int sup = 750;
    while (inf + 1 < sup) {
      int med = (inf + sup) / 2;
      if (b >= valorconrechazos[med])
        sup = med;
      else
        inf = med;
    }
    cout << sup << endl;
  }
}
