#include <bits/stdc++.h>
using namespace std;
void fre() {
  freopen("c://test//input.in", "r", stdin);
  freopen("c://test//output.out", "w", stdout);
}
template <class T1, class T2>
inline void gmax(T1 &a, T2 b) {
  if (b > a) a = b;
}
template <class T1, class T2>
inline void gmin(T1 &a, T2 b) {
  if (b < a) a = b;
}
const int N = 800, M = 0, Z = 1e9 + 7, inf = 0x3f3f3f3f;
template <class T1, class T2>
inline void gadd(T1 &a, T2 b) {
  a = (a + b) % Z;
}
int n, m;
int a[N];
long long f[N][N];
int main() {
  while (~scanf("%d%d", &n, &m)) {
    for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
    memset(f, 63, sizeof(f));
    memset(f[n + 1], 0, sizeof(f[n + 1]));
    for (int i = n; i >= 1; --i) {
      for (int j = 0; j <= n; ++j) {
        f[i][j] = max(f[i + 1][j] - a[i], 0ll);
        if (j) gmin(f[i][j - 1], max(f[i][j] + min(a[i], 0), 0ll));
      }
    }
    for (int i = 1; i <= m; ++i) {
      long long x;
      scanf("%lld", &x);
      int ans = upper_bound(f[1], f[1] + n + 1, x) - f[1] - 1;
      printf("%d\n", n - ans);
    }
  }
  return 0;
}
