#include <bits/stdc++.h>
using namespace std;
long long k[200009], n, q;
vector<long long> a;
int main() {
  cin >> n >> q;
  a.resize(n + 1);
  a[0] = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    a[i] += a[i - 1];
  }
  long long idx = 1, rem = 0;
  while (q--) {
    long long k;
    cin >> k;
    k += rem;
    long long i =
        upper_bound(a.begin() + 1, a.end(), k + a[idx - 1]) - a.begin();
    if (i == n + 1) {
      printf("%lld\n", n);
      idx = 1, rem = 0;
    } else {
      printf("%lld\n", n - i + 1);
      rem = k - (a[i - 1] - a[idx - 1]), idx = i;
    }
  }
  return 0;
}
