#include <bits/stdc++.h>
using namespace std;
int a[755];
long long dp[755][755];
int n, m;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> a[i];
  dp[n + 1][0] = 0;
  for (int i = n; i >= 1; i--) {
    for (int j = 0; j <= n; j++) {
      dp[i][j] = min(dp[i + 1][j] + a[i], (long long)0);
      if (j > 0) dp[i][j] = max(dp[i][j], dp[i + 1][j - 1]);
    }
  }
  while (m--) {
    long long x;
    cin >> x;
    cout << lower_bound(dp[1], dp[1] + n + 1, -x) - dp[1] << endl;
  }
  return 0;
}
