#include <bits/stdc++.h>
int n, q;
long long a[200001], s[200001], k, cur;
int search(long long ans) {
  int l = 0, r = n, c;
  while (r - l > 1) {
    c = (l + r) / 2;
    if (s[c] == ans) return c;
    if (s[l] == ans) return l;
    if (s[r] == ans) return r;
    if (s[c] > ans)
      r = c;
    else
      l = c;
  }
  return l;
}
int main() {
  scanf("%d %d", &n, &q);
  for (int i = 0; i < n; i++) scanf("%lld", a + i);
  for (int i = 0; i < n; i++) s[i + 1] = s[i] + a[i];
  while (q--) {
    scanf("%lld", &k);
    cur += k;
    if (cur >= s[n]) cur = 0;
    int ans = search(cur);
    ans = n - ans;
    printf("%d\n", ans);
  }
  return 0;
}
