#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long n, q;
  scanf("%I64d %I64d", &n, &q);
  vector<long long> a(n + 1);
  vector<long long> b(q);
  a[0] = 0;
  for (long long i = 1; i <= n; i++) {
    scanf("%I64d", &a[i]);
  }
  n++;
  for (long long i = 0; i < q; i++) {
    scanf("%I64d", &b[i]);
  }
  vector<long long> pr(n);
  pr[0] = 0;
  for (long long i = 1; i < n; i++) {
    pr[i] = pr[i - 1] + a[i];
  }
  long long t = 0;
  for (long long i = 0; i < q; i++) {
    vector<long long>::iterator it =
        upper_bound(pr.begin(), pr.end(), b[i] + t);
    if (it == pr.end()) {
      cout << n - 1 << "\n";
      t = 0;
    } else {
      cout << pr.end() - it << "\n";
      t += b[i];
    }
  }
}
