#include <bits/stdc++.h>
using namespace std;
priority_queue<long long> q;
inline long long read() {
  register long long x(0), f(1);
  register char c(getchar());
  while (c > '9' || c < '0') f = c == '-' ? -1 : 1, c = getchar();
  while (c >= '0' && c <= '9') x = x * 10 + c - 48, c = getchar();
  return f * x;
}
const int N = 755;
long long n, m, a[N], pre[N], cnt;
int main() {
  n = read(), m = read();
  for (int i = 1; i <= n; ++i) a[i] = read();
  for (int i = n; i >= 1; --i) {
    if (a[i] < 0)
      q.push(a[i]);
    else {
      while (!q.empty() && a[i] >= 0) a[i] += q.top(), q.pop();
      if (a[i] < 0) q.push(a[i]);
    }
  }
  while (!q.empty()) pre[++cnt] = q.top(), q.pop();
  for (int i = 1; i <= cnt; i++) pre[i] = -pre[i] + pre[i - 1];
  while (m--) {
    long long x = read();
    cout << (cnt - (upper_bound(pre + 1, pre + 1 + cnt, x) - pre) + 1) << endl;
  }
  return 0;
}
