#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
long long w[MAXN], t[MAXN], pref[MAXN];
int main() {
  ios::sync_with_stdio(0);
  int n, q;
  cin >> n >> q;
  for (int i = 0; i < n; ++i) {
    if (i > 0) pref[i] += pref[i - 1];
    cin >> w[i];
    pref[i] += w[i];
  }
  for (int i = 1; i <= q; ++i) {
    cin >> t[i];
  }
  long long now = 0;
  long long ptr = 0;
  for (int i = 1; i <= q; ++i) {
    now += t[i];
    long long x = lower_bound(pref, pref + n, now) - pref;
    if (pref[x] > now) --x;
    if (x >= n - 1) {
      now = 0;
      cout << n << endl;
    } else {
      cout << n - x - 1 << endl;
    }
  }
  return 0;
}
