#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30;
const long long INF = 1000000000000000LL;
const long double pi = acos(-1);
const int mod = 1e9 + 7;
struct ii {
  int x, y;
  ii(int x = 0, int y = 0) : x(x), y(y) {}
  bool operator==(const ii &a) const { return x == a.x && y == a.y; }
  bool operator<(const ii &a) const {
    if (x != a.x) return x < a.x;
    return y < a.y;
  }
  ii friend operator+(ii a, ii b) { return ii(a.x + b.x, a.y + b.y); }
  ii friend operator-(ii a, ii b) { return ii(a.x - b.x, a.y - b.y); }
};
template <class T>
void sc(T &x) {
  char c;
  x = 0;
  int t = 1;
  while (c = getchar(), c < 48)
    if (c == '-') t = -1;
  do x = x * 10 + (c ^ 48);
  while (c = getchar(), c > 47);
  x = x * t;
}
template <class T>
void nt(T x) {
  if (!x) return;
  nt(x / 10);
  putchar(x % 10 + '0');
}
template <class T>
void pt(T x) {
  if (x < 0) putchar('-'), x = -x;
  if (!x)
    putchar('0');
  else
    nt(x);
}
template <class T>
void pts(T x) {
  pt(x);
  putchar(' ');
}
template <class T>
void ptn(T x) {
  pt(x);
  putchar('\n');
}
template <class T>
void pp(T x, int y) {
  static char ch[] = {" \n"};
  pt(x);
  putchar(ch[y]);
}
template <class T>
void Max(T &x, T y) {
  if (x < y) x = y;
}
template <class T>
void Min(T &x, T y) {
  if (x > y) x = y;
}
const int maxn = 800;
int n, m;
long long a[maxn], d[maxn];
int solve2(long long v) {
  priority_queue<long long, vector<long long>, greater<long long> > heap;
  for (int i = 0, i_ = (n)-1; i <= i_; ++i) {
    v += a[i];
    heap.push(a[i]);
    while (v < 0) v -= heap.top(), heap.pop();
  }
  return heap.size();
}
void solve(int l, int r, long long lx, long long rx) {
  int mid = l + r >> 1;
  long long L = lx, R = rx, res = -1;
  while (L <= R) {
    long long Mid = L + R >> 1;
    if (solve2(Mid) >= mid) {
      res = Mid;
      R = Mid - 1;
    } else
      L = Mid + 1;
  }
  d[mid] = res;
  if (mid > l) solve(l, mid - 1, lx, res);
  if (mid < r) solve(mid + 1, r, res, rx);
}
int main() {
  sc(n);
  sc(m);
  for (int i = 0, i_ = (n)-1; i <= i_; ++i) sc(a[i]);
  solve(0, n, 0, INF);
  for (int i = 0, i_ = (m)-1; i <= i_; ++i) {
    long long k;
    sc(k);
    int t = upper_bound(d, d + n + 1, k) - d - 1;
    ptn(n - t);
  }
  return 0;
}
