#include <bits/stdc++.h>
const long long INF = (long long)1e18;
const size_t nmax = 750;
long long problem[nmax];
long long dp[nmax + 1][nmax + 1];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%I64d", &problem[i]);
  for (int i = 0; i < n + 1; i++) {
    for (int j = n - 1; j >= 0; j--) {
      long long b = std::min(0LL, dp[i][j + 1]) + problem[j];
      if (i == 0) {
        dp[i][j] = b;
      } else {
        long long a = dp[i - 1][j + 1];
        dp[i][j] = std::max(a, b);
      }
    }
  }
  std::vector<long long> a;
  for (int i = 0; i < n + 1; i++) {
    a.push_back(dp[i][0]);
  }
  while (m--) {
    long long x;
    scanf("%I64d", &x);
    printf("%d\n", std::lower_bound(a.begin(), a.end(), -x) - a.begin());
  }
  return 0;
}
