#include <bits/stdc++.h>
using namespace std;
int N, Q;
long long arr[800];
long long ans[800];
long long query[300000];
long long qs[300000];
priority_queue<long long, vector<long long>, greater<long long> > pq;
long long lo, hi;
int test(long long val) {
  int res = 0;
  for (int i = 0; i < N; i++) {
    pq.push(arr[i]);
    val += arr[i];
    if (val < 0) {
      val -= pq.top();
      pq.pop();
      res++;
    }
  }
  while (!pq.empty()) {
    pq.pop();
  }
  return res;
}
int readint() {
  char c = ' ';
  while (c < '0') {
    c = getchar();
  }
  int res = 0;
  while (c >= '0') {
    res = 10 * res + c - '0';
    c = getchar();
  }
  return res;
}
long long readnegativell() {
  char c = ' ';
  while (c < '-') {
    c = getchar();
  }
  bool negative = false;
  if (c == '-') {
    negative = true;
    c = getchar();
  }
  long long res = 0;
  while (c >= '0') {
    res = 10 * res + c - '0';
    c = getchar();
  }
  if (negative) {
    res *= -1;
  }
  return res;
}
void printint(int z) {
  if (z < 0) {
    putchar('-');
    z = -z;
  }
  if (z == 0) {
    putchar('0');
    return;
  }
  char arr[20];
  int ite = 0;
  while (z) {
    arr[ite] = (z % 10) + '0';
    z /= 10;
    ite++;
  }
  for (int i = ite - 1; i >= 0; i--) {
    putchar(arr[i]);
  }
}
int32_t main() {
  if (fopen("cf727f.in", "r")) {
    freopen("cf727f.in", "r", stdin);
    freopen("cf727f.out", "w", stdout);
  }
  N = readint();
  Q = readint();
  for (int i = 0; i < N; i++) {
    arr[i] = readnegativell();
  }
  for (int i = 0; i < Q; i++) {
    query[i] = readnegativell();
    qs[i] = query[i];
  }
  qs[Q] = 1000000000000000001ll;
  sort(qs, qs + Q + 1);
  for (int i = 0; i < N; i++) {
    lo = -1;
    hi = Q + 1;
    while (hi - lo > 1 && hi > 0) {
      long long mid = (hi + lo) / 2;
      int q = test(qs[mid]);
      if (q <= i) {
        hi = mid;
      } else {
        lo = mid;
      }
    }
    ans[N - 1 - i] = qs[hi];
  }
  for (int i = 0; i < Q; i++) {
    printint(N - (upper_bound(ans, ans + N, query[i]) - ans));
    putchar('\n');
  }
  return 0;
}
