#include <bits/stdc++.h>
int a[800], n, m;
long long f[800][800];
int main() {
  scanf("%d%d\n", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  memset(f, 127, sizeof f);
  f[n + 1][0] = 0;
  for (int i = n; i; i--)
    for (int j = 0; j <= n - i + 1; j++) {
      f[i][j] = f[i + 1][j];
      if (j) f[i][j] = std::min(f[i][j], std::max(f[i + 1][j - 1] - a[i], 0ll));
    }
  for (int i = 1; i <= m; i++) {
    long long x;
    scanf("%I64d\n", &x);
    printf("%d\n", n - (std::upper_bound(f[1], f[1] + n + 1, x) - f[1] - 1));
  }
}
