#include <bits/stdc++.h>
using namespace std;
long long solve(long long x, vector<long long> &prefix, vector<long long> &v,
                long long &hits, long long pos) {
  if (hits + x < v[pos]) {
    hits += x;
    return pos;
  }
  long long n = v.size() - 1, temp;
  long long low = pos, high = n, mid, ind = pos;
  while (low <= high) {
    mid = low + (high - low) / 2;
    temp = prefix[mid] - prefix[pos - 1] - hits;
    if (temp <= x) {
      ind = mid;
      low = mid + 1;
    } else
      high = mid - 1;
  }
  if (ind == n) {
    hits = 0;
    return 1;
  }
  ind++;
  temp = prefix[ind] - prefix[pos - 1] - x - hits;
  hits = v[ind] - temp;
  return ind;
}
int32_t main() {
  long long n, q, x;
  cin >> n >> q;
  vector<long long> v(n + 1), prefix(n + 1, 0);
  for (long long i = 1; i <= n; i++) {
    cin >> v[i];
    prefix[i] = v[i];
    prefix[i] += prefix[i - 1];
  }
  long long hits = 0, pos = 1;
  while (q--) {
    cin >> x;
    pos = solve(x, prefix, v, hits, pos);
    cout << (n - pos + 1) << "\n";
  }
  return 0;
}
