#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 1;
long long a[N], b, n, m, s[N], cnt, ans;
priority_queue<long long> q;
inline bool isdigit(const char &ch) { return (ch >= '0' && ch <= '9'); }
inline long long read() {
  register long long s = 0ll;
  register bool m = false;
  register char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') m = true;
    ch = getchar();
  }
  while (isdigit(ch)) s = (s << 1ll) + (s << 3ll) + (ch ^ 48ll), ch = getchar();
  return m ? -s : s;
}
inline void write(register long long x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
inline void print(const long long &ans) {
  write(ans);
  puts("");
}
signed main(int _lzh, char const *__lzh[]) {
  n = read(), m = read();
  for (register long long i = 1; i <= n; ++i) a[i] = read();
  for (register long long i = n; i >= 1; --i) {
    while (!q.empty() && a[i] >= 0) {
      a[i] += q.top();
      q.pop();
    }
    if (a[i] < 0) q.push(a[i]);
  }
  while (!q.empty()) {
    s[++cnt] = -q.top();
    s[cnt] += s[cnt - 1];
    q.pop();
  }
  while (m--) {
    b = read();
    print(cnt - (upper_bound(s + 1, s + cnt + 1, b) - s - 1));
  }
  return 0;
}
