#include <bits/stdc++.h>
using namespace std;
long long n, m, a[1200000], v[1200000], q[1200000], ans[1200000];
priority_queue<long long> que;
inline bool cmp(long long a, long long b) { return v[a] < v[b]; }
void put(long long x) {
  if (x < 0)
    que.push(x);
  else {
    if (que.empty() || !x) return;
    long long now = que.top();
    que.pop();
    if (now + x >= 0)
      put(now + x);
    else
      que.push(now + x);
  }
}
signed main() {
  cin >> n >> m;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  for (long long i = 1; i <= m; i++) {
    cin >> v[i];
    q[i] = i;
  }
  sort(q + 1, q + m + 1, cmp);
  for (long long i = n; i >= 1; i--) put(a[i]);
  for (long long i = 1; i <= m; i++) {
    put(v[q[i]] - v[q[i - 1]]);
    ans[q[i]] = que.size();
  }
  for (long long i = 1; i <= m; i++) cout << ans[i] << '\n';
}
