#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
const int maxn = 2e6 + 5;
const long long mod = 1e9 + 7;
const double PI = acos(-1.0);
long long po(long long a, long long b, long long mod) {
  long long res = 1;
  a %= mod;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long gcd(long long a, long long b) {
  if (a == 0) {
    return b;
  } else {
    return gcd(b % a, a);
  }
}
long long n, m;
long long a[1005], b[maxn], ans[1005];
int check(long long x) {
  priority_queue<int> que;
  int res = 0;
  for (int i = 1; i <= n; i++) {
    que.push(-a[i]);
    x += a[i];
    if (x <= 0) {
      res++;
      int t = que.top();
      que.pop();
      x += t;
    }
  }
  return res;
}
void solve() {
  scanf("%lld%lld", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
  }
  for (int i = 1; i <= m; i++) {
    scanf("%lld", &b[i]);
  }
  for (int i = 0; i <= n; i++) {
    long long le = -1e12;
    long long ri = 1e12;
    while (le < ri) {
      long long mid = (le + ri + 1) >> 1;
      if (check(mid) >= i) {
        le = mid;
      } else {
        ri = mid - 1;
      }
    }
    ans[i] = le;
  }
  sort(ans, ans + 1 + n);
  for (int i = 1; i <= m; i++) {
    int p = upper_bound(ans, ans + n + 1, b[i]) - ans;
    p = n - p;
    printf("%d\n", max(p, 0));
  }
}
int main() {
  solve();
  return 0;
}
