#include <bits/stdc++.h>
using namespace std;
long long f[755][755];
int n, q;
int a[755];
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  memset(f, 63, sizeof(f));
  f[n + 1][0] = 0;
  for (int i = n; i >= 1; i--) {
    f[i][0] = min(0ll, f[i + 1][0] + a[i]);
    for (int j = 1; j <= n - i + 1; j++) {
      f[i][j] = f[i + 1][j - 1];
      f[i][j] = max(f[i][j], min(0ll, f[i + 1][j] + a[i]));
    }
  }
  for (int i = 1; i <= q; i++) {
    long long x;
    scanf("%I64d", &x);
    for (int j = 0; j <= n; j++) {
      if (x + f[1][j] >= 0) {
        printf("%d\n", j);
        break;
      }
    }
  }
  return 0;
}
