#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
int a[N];
long long acc[N];
int main() {
  int n, q;
  scanf("%d %d ", &n, &q);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  int curr = 0;
  acc[0] = a[0];
  for (int i = 1; i < n; i++) acc[i] = acc[i - 1] + a[i];
  long long rem = 0;
  while (q--) {
    long long k;
    scanf("%lld", &k);
    if (curr) k += acc[curr - 1];
    k += rem;
    curr = upper_bound(acc + curr, acc + n, k) - acc;
    if (curr == n)
      curr = 0, rem = 0;
    else {
      if (curr)
        rem = k - acc[curr - 1];
      else
        rem = k;
    }
    printf("%d\n", n - curr);
  }
  return 0;
}
