#include <bits/stdc++.h>
using namespace std;
template <class T, class S>
ostream& operator<<(ostream& os, const pair<T, S>& v) {
  return os << "(" << v.first << ", " << v.second << ")";
}
template <class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  os << "[";
  for (int i = int(0); i <= int((static_cast<int>((v).size())) - 1); ++i) {
    if (i) os << ", ";
    os << v[i];
  }
  return os << "]";
}
template <class T>
bool setmax(T& _a, T _b) {
  if (_b > _a) {
    _a = _b;
    return true;
  }
  return false;
}
template <class T>
bool setmin(T& _a, T _b) {
  if (_b < _a) {
    _a = _b;
    return true;
  }
  return false;
}
template <class T>
T gcd(T _a, T _b) {
  return _b == 0 ? _a : gcd(_b, _a % _b);
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  vector<int> a(n);
  for (int i = int(0); i <= int((n)-1); ++i) scanf("%d", &a[i]);
  vector<vector<long long> > f(n + 1, vector<long long>(n + 1));
  fill((f[n]).begin(), (f[n]).end(), 0);
  for (int i = int((n)-1); i >= int(0); --i) {
    for (int c = int(0); c <= int(n); ++c) {
      f[i][c] = min((long long)a[i], f[i + 1][c] + a[i]);
      if (c > 0) setmax(f[i][c], f[i + 1][c - 1]);
    }
  }
  while (m--) {
    long long b;
    scanf("%lld", &b);
    int p = int(lower_bound((f[0]).begin(), (f[0]).end(), -b) - f[0].begin());
    printf("%d\n", p);
  }
  return 0;
}
