#include <bits/stdc++.h>
int n, q, a[200010];
unsigned long long int k[200010], sum[200010];
void input() {
  scanf("%d %d", &n, &q);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    if (i)
      sum[i] = sum[i - 1] + a[i];
    else
      sum[i] = a[i];
  }
  sum[n] = pow(10, 9) * 200000 + 1;
  for (int i = 0; i < q; i++) scanf("%lld", &k[i]);
}
void solve() {
  unsigned long long int Minus = 0;
  for (int i = 0; i < q; i++) {
    int st = 0, en = n;
    if (sum[n - 1] <= k[i] + Minus) {
      Minus = 0;
      printf("%d\n", n);
      continue;
    } else if (sum[0] > k[i] + Minus) {
      Minus += k[i];
      printf("%d\n", n);
      continue;
    }
    while (st + 1 < en) {
      int mid = (st + en) / 2;
      if (sum[mid] <= k[i] + Minus)
        st = mid;
      else
        en = mid;
    }
    Minus += k[i];
    printf("%d\n", n - en);
  }
}
int main() {
  input();
  solve();
}
