#include <bits/stdc++.h>
using namespace std;
int IN() {
  int x = 0, f = 0, ch;
  for (; (ch = getchar()) < '0' || ch > '9';) f = (ch == '-');
  for (; ch >= '0' && ch <= '9'; (ch = getchar())) x = x * 10 + ch - '0';
  return f ? -x : x;
}
int N, M, A[755];
long long F[755][755], Ans[755];
int main(int argc, char* argv[]) {
  N = IN();
  M = IN();
  for (int i = 1, lim = N; i <= lim; i++) A[i] = IN();
  for (int i = 0, lim = N; i <= lim; i++)
    for (int j = 0, lim = N; j <= lim; j++) F[i][j] = -(1ll << 60);
  for (int i = N, lim = 1; i >= lim; i--)
    for (int j = 0, lim = N; j <= lim; j++) {
      F[i][j] = max(F[i][j], min(A[i] + 0ll, F[i + 1][j] + A[i]));
      F[i][j + 1] = max(F[i][j + 1], F[i + 1][j]);
    }
  for (int i = 0, lim = N; i <= lim; i++) Ans[i] = F[1][i];
  for (long long x; M--;) {
    scanf("%lld", &x);
    printf("%d\n", lower_bound(Ans, Ans + N + 1, -x) - Ans);
  }
  return 0;
}
