#include <bits/stdc++.h>
int n, q;
long long a[300000], k[300000], sum[300000];
int find(long long x) {
  int l = 1;
  int r = n;
  int ans = 0;
  while (l <= r) {
    int mid = (l + r) / 2;
    if (sum[mid] <= x) {
      ans = mid;
      l = mid + 1;
    } else
      r = mid - 1;
  }
  if (sum[ans + 1] <= x && ans != n) ++ans;
  return ans;
}
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]), sum[i] = sum[i - 1] + a[i];
  long long hurt = 0;
  for (int i = 1; i <= q; i++) {
    long long x;
    scanf("%lld", &x);
    hurt += x;
    int l = find(hurt);
    if (l == n)
      printf("%d\n", n), hurt = 0;
    else
      printf("%d\n", n - l);
  }
  return 0;
}
