#include <bits/stdc++.h>
const int NN = 1e3 + 10;
using namespace std;
long long n, m, a[NN], dp[NN][NN];
int main() {
  scanf("%lld%lld", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%lld", a + i);
  dp[n + 1][0] = 0;
  for (int i = n; i >= 1; i--)
    for (int j = 0; j <= n; j++)
      dp[i][j] =
          max(min(dp[i + 1][j] + a[i], 0ll), j ? dp[i + 1][j - 1] : -1ll << 60);
  while (m--) {
    long long temp;
    scanf("%lld", &temp);
    printf("%d\n", lower_bound(dp[1], dp[1] + n + 1, -temp) - dp[1]);
  }
  return 0;
}
