#include <bits/stdc++.h>
using namespace std;
const int N = 777;
int n, m;
int a[N];
long long f[N][N];
int main() {
  while (~scanf("%d%d", &n, &m)) {
    memset(f, 0x3f, sizeof(f));
    for (int i = (1); i < (n + 1); i++) scanf("%d", a + i);
    for (int i = (1); i < (n + 1); i++) f[i][0] = 0;
    f[n][1] = max(0, -a[n]);
    for (int i = n - 1; i; --i) {
      for (int j = (1); j < (n - i + 2); j++) {
        f[i][j] = min(f[i + 1][j], max(0ll, f[i + 1][j - 1] - a[i]));
      }
    }
    while (m--) {
      long long x;
      scanf("%lld", &x);
      int p = upper_bound(f[1], f[1] + n + 1, x) - f[1] - 1;
      printf("%d\n", n - p);
    }
  }
  return 0;
}
