#include <bits/stdc++.h>
using namespace std;
long long int dp[755][755];
long long int t = 0;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  long long int a[755];
  int sum = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &a[i]);
    if (a[i] < 0) sum++;
  }
  if (sum == 0) {
    while (m--) {
      int b;
      scanf("%d", &b);
      printf("0\n");
    }
  } else {
    memset(dp, 0, sizeof(dp));
    for (int i = n; i >= 1; i--) {
      for (int j = 0; j <= sum; j++) {
        if (a[i] >= 0) {
          dp[i][j] = max(t, dp[i + 1][j] - a[i]);
        } else {
          if (j >= 1)
            dp[i][j] = min(dp[i + 1][j] - a[i], dp[i + 1][j - 1]);
          else
            dp[i][j] = dp[i + 1][j] - a[i];
        }
      }
    }
    while (m--) {
      long long int b;
      scanf("%I64d", &b);
      int l = 0, r = sum;
      while (l < r) {
        int mid = (l + r) / 2;
        if (dp[1][mid] <= b) {
          r = mid;
        } else {
          l = mid + 1;
        }
      }
      printf("%d\n", l);
    }
  }
  return 0;
}
