#include <bits/stdc++.h>
using namespace std;
long long x[755][755], t = 0;
int main() {
  int n, m;
  cin >> n >> m;
  long long int a[755];
  int sum = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] < 0) sum++;
  }
  if (sum == 0) {
    while (m--) {
      int b;
      cin >> b;
      cout << 0 << endl;
    }
  } else {
    for (int i = n; i >= 1; i--) {
      for (int j = 0; j <= sum; j++) {
        if (a[i] >= 0) {
          x[i][j] = max(t, x[i + 1][j] - a[i]);
        } else {
          if (j >= 1)
            x[i][j] = min(x[i + 1][j] - a[i], x[i + 1][j - 1]);
          else
            x[i][j] = x[i + 1][j] - a[i];
        }
      }
    }
    while (m--) {
      long long b;
      cin >> b;
      int l = 0, r = sum;
      while (l < r) {
        int mid = (l + r) / 2;
        if (x[1][mid] <= b) {
          r = mid;
        } else {
          l = mid + 1;
        }
      }
      cout << l << endl;
    }
  }
  return 0;
}
