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