#include <bits/stdc++.h>
using namespace std;
long long n, m, i, j, t, a[1001], f[1001][1001];
int main() {
  scanf("%lld%lld", &n, &m);
  for (i = 1; i <= n; i++) scanf("%lld", &a[i]);
  memset(f, 127, sizeof(f));
  f[n + 1][0] = 0;
  for (i = n; i; i--)
    for (j = 0; j <= n - i + 1; j++) {
      f[i][j] = f[i + 1][j];
      if (j) f[i][j] = min(f[i][j], max(0ll, f[i + 1][j - 1] - a[i]));
    }
  for (i = 1; i <= m; i++) {
    scanf("%lld", &t);
    printf("%lld\n", n - (std::upper_bound(f[1], f[1] + n + 1, t) - f[1] - 1));
  }
}
