#include <bits/stdc++.h>
using namespace std;
const int maxn = 1005;
int n, m;
long long int a[maxn], f[maxn][maxn], tmp[maxn];
inline void solve() {
  long long int q;
  cin >> q;
  int pos = upper_bound(tmp, tmp + n + 1, q) - tmp;
  cout << n - pos + 1 << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  reverse(a + 1, a + n + 1);
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= i; ++j)
      f[i][j] = min(max(f[i - 1][j] - a[i], (long long int)0), f[i - 1][j - 1]);
    f[i][0] = max(f[i - 1][0] - a[i], (long long int)0);
  }
  for (int i = 0; i <= n; ++i) tmp[i] = f[n][n - i];
  while (m--) solve();
  return 0;
}
