#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 7;
vector<long long> ans;
int n, m, a[N];
long long pre[N];
bool used[N];
long long getMinPre(int l, int r) {
  if (l > r) return 1e18;
  long long ans = pre[l];
  while (l < r) ans = min(ans, pre[++l]);
  return ans;
}
bool umax(long long &a, long long b) {
  if (b > a) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    pre[i] = pre[i - 1] + a[i];
  }
  ans.push_back(getMinPre(1, n));
  for (int i = 1; i <= n; i++) {
    long long maxv = -1e18, id;
    long long g[n + 2], f = 1e18;
    g[n + 1] = 1e18;
    for (int j = n; j >= 1; j--) g[j] = min(g[j + 1], pre[j]);
    for (int j = 1; j <= n; j++) {
      if (!used[j] && umax(maxv, min(f, g[j + 1] - a[j]))) {
        id = j;
      }
      f = min(f, pre[j]);
    }
    used[id] = 1;
    pre[id] = 1e18;
    for (int j = id + 1; j <= n; j++) {
      if (!used[j]) pre[j] -= a[id];
    }
    ans.push_back(getMinPre(1, n));
  }
  while (m--) {
    long long q;
    scanf("%I64d", &q);
    printf("%d\n", lower_bound(ans.begin(), ans.end(), -q) - ans.begin());
  }
  return 0;
}
