#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  char c = getchar();
  long long x = 0;
  bool f = 0;
  for (; !isdigit(c); c = getchar()) f ^= !(c ^ 45);
  for (; isdigit(c); c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48);
  if (f) x = -x;
  return x;
}
const long long M = 760;
long long n, m, a[M], dp[M][M];
signed main() {
  n = read(), m = read();
  for (long long i = 1; i <= n; i++) a[i] = read();
  memset(dp, 0x3f, sizeof(dp));
  dp[n + 1][0] = 0;
  for (long long i = n; i >= 1; i--)
    for (long long j = 0; j <= n; j++)
      dp[i][j] = min(dp[i + 1][j], max(0ll, dp[i + 1][j - 1] - a[i]));
  for (long long i = 1; i <= m; i++) {
    long long tl = 0, tr = n, ans, x = read();
    while (tl <= tr) {
      long long Mid = (tl + tr) >> 1;
      if (dp[1][Mid] > x)
        tr = Mid - 1;
      else
        tl = Mid + 1, ans = Mid;
    }
    cout << n - ans << endl;
  }
  return 0;
}
