#include <bits/stdc++.h>
using namespace std;
int n, m;
long long a[1005], f[1005][1005];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  memset(f, 0x3f, sizeof f);
  f[n + 1][0] = 0;
  for (int i = n; i >= 1; i--) {
    for (int j = 1; j <= n - i + 1; j++)
      f[i][j] = min(f[i + 1][j], max((long long)0, f[i + 1][j - 1] - a[i]));
    f[i][0] = 0;
  }
  while (m--) {
    long long k;
    scanf("%lld", &k);
    for (int i = n; i >= 0; i--)
      if (f[1][i] <= k) {
        printf("%d\n", n - i);
        break;
      }
  }
}
