#include <bits/stdc++.h>
using namespace std;
int ans, q, n;
long long k, sum[200010], a[200010];
int GetPos(long long temp) {
  int Left = 0, Right = n;
  while (Left < Right) {
    int Mid = Left + (Right - Left + 1) / 2;
    if (sum[Mid] <= temp)
      Left = Mid;
    else
      Right = Mid - 1;
  }
  return Left;
}
int main() {
  long long temp = 0;
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
    sum[i] = sum[i - 1] + a[i];
  }
  ans = 0;
  for (int i = 1; i <= q; i++) {
    scanf("%lld", &k);
    temp += k;
    if (temp >= sum[n]) {
      temp = 0;
      ans = 0;
    } else
      ans = GetPos(temp);
    printf("%d\n", n - ans);
  }
  return 0;
}
