#include <bits/stdc++.h>
using namespace std;
long long a[200010], sum[200010];
int main() {
  int n, q;
  scanf("%d%d", &n, &q);
  memset(sum, 0, sizeof(sum));
  for (int i = 0; i < n; i++) scanf("%I64d", &a[i]);
  sum[0] = a[0];
  for (int i = 1; i < n; i++) sum[i] = sum[i - 1] + a[i];
  long long preK = 0;
  while (q--) {
    long long k;
    scanf("%I64d", &k);
    if (preK + k > sum[n - 1]) {
      preK = 0;
      printf("%d\n", n);
    } else {
      long long ans;
      int index = lower_bound(sum, sum + n, preK + k) - sum;
      if (sum[index] == preK + k)
        ans = n - 1 - index;
      else
        ans = n - index;
      if (ans == 0) {
        ans = n;
        preK = 0;
        printf("%d\n", n);
        continue;
      }
      printf("%I64d\n", ans);
      preK += k;
    }
  }
}
