#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const int N = 1e3 + 10;
int n, m, a[N];
long long dp[N][N], x;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  memset(dp, inf, sizeof(dp));
  dp[n + 1][0] = 0;
  for (int i = n; i > 0; i--)
    for (int j = 0; j <= n - i + 1; j++) {
      dp[i][j] = dp[i + 1][j];
      if (j) dp[i][j] = min(dp[i][j], max(dp[i + 1][j - 1] - a[i], 0ll));
    }
  for (int i = 1; i <= m; i++) {
    scanf("%lld", &x);
    printf("%d\n", n - (upper_bound(dp[1], dp[1] + n + 1, x) - dp[1] - 1));
  }
  return 0;
}
