#include <bits/stdc++.h>
using namespace std;
long long s[1001], a[1001], k;
int n, m;
int main() {
  int i, j;
  scanf("%d %d", &n, &m);
  memset(s, 0, sizeof(s));
  for (i = 1; i <= n; i++) scanf("%lld", &a[i]);
  for (i = n; i >= 0; i--)
    for (j = n; j >= 0; j--) {
      k = (j == 0) ? -1e17 : s[j - 1];
      s[j] = max(min(s[j] + a[i], (long long)0), k);
    }
  while (m--) {
    scanf("%lld", &k);
    printf("%d\n", lower_bound(s, s + n + 1, -k) - s);
  }
  return 0;
}
