#include <bits/stdc++.h>
using namespace std;
const long long N = 800;
long long n, m, a[N], dp[N][N], ans[N];
signed main() {
  scanf("%lld%lld", &n, &m);
  for (long long i = n; i >= 1; i--) scanf("%lld", &a[i]);
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j < i; j++)
      dp[i][j] = min(dp[i - 1][j], max(0ll, dp[i - 1][j - 1] - a[i]));
    dp[i][i] = max(0ll, dp[i - 1][i - 1] - a[i]);
  }
  for (long long i = 0; i <= n; i++) ans[i] = dp[n][i];
  for (long long i = 1; i <= m; i++) {
    long long q;
    scanf("%lld", &q);
    printf("%lld\n",
           n + 1 - (long long)(upper_bound(ans, ans + n + 1, q) - ans));
  }
  return 0;
}
