#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, y = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') y = 1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
  return y ? -x : x;
}
template <typename T>
inline T read() {
  T x = 0;
  int y = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') y = 1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
  return y ? -x : x;
}
int a[1005];
long long sum[1005];
priority_queue<int> q;
signed main() {
  int n = read(), m = read(), len = 0;
  for (register int i = 1; i <= n; ++i) a[i] = read();
  for (register int i = n; i; --i) {
    if (a[i] < 0)
      q.push(a[i]);
    else {
      while (!q.empty()) {
        int x = q.top();
        q.pop();
        if (a[i] + x >= 0)
          a[i] += x;
        else {
          q.push(x += a[i]);
          break;
        }
      }
    }
  }
  while (!q.empty()) {
    ++len;
    sum[len] = sum[len - 1] - q.top();
    q.pop();
  }
  while (m--) {
    long long d = read<long long>();
    int l = 0, r = len, mid;
    while (l < r) {
      mid = l + r + 1 >> 1;
      if (sum[mid] <= d)
        l = mid;
      else
        r = mid - 1;
    }
    printf("%d\n", len - l);
  }
}
