#include <bits/stdc++.h>
using namespace std;
long long a[800], dp[800][800];
int n, m;
long long ans[800];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) scanf("%lld", &a[i]);
  for (int i = 0; i < 800; ++i)
    for (int j = 0; j < 800; ++j) dp[i][j] = (1LL << 55);
  dp[n + 1][0] = 0;
  for (int i = n; i; --i) {
    for (int j = 0; i + j <= n; ++j) {
      dp[i][j] = min(dp[i][j], max(0LL, dp[i + 1][j] - a[i]));
      dp[i][j + 1] = min(dp[i][j + 1], dp[i + 1][j]);
    }
  }
  ans[n] = 0;
  for (int i = n - 1; i >= 0; --i) ans[i] = max(ans[i + 1], dp[1][i]);
  while (m--) {
    long long x;
    scanf("%lld", &x);
    printf("%d\n",
           lower_bound(ans, ans + n + 1, x, greater<long long>()) - ans);
  }
  return 0;
}
