#include <bits/stdc++.h>
using namespace std;
const int N = 760;
const long long INF = 1e18;
int n, m, a[N];
long long f[N][N];
vector<long long> v;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 0; i <= n + 1; i++)
    for (int j = 0; j <= n; j++) f[i][j] = -INF;
  f[n + 1][0] = 0;
  for (int i = n; i >= 1; i--)
    for (int j = 0; j <= n; j++) {
      if (j <= n - i)
        f[i][j] = max(f[i][j], min(f[i + 1][j] + a[i], (long long)a[i]));
      if (j > 0) f[i][j] = max(f[i][j], f[i + 1][j - 1]);
    }
  for (int i = 0; i <= n - 1; i++) v.push_back(f[1][i]);
  while (m--) {
    long long x;
    cin >> x;
    int it = lower_bound(v.begin(), v.end(), -x) - v.begin();
    cout << it << endl;
  }
}
