#include <bits/stdc++.h>
using namespace std;
long long a[200010], s[200010];
int main() {
  int n, m, i, j, k;
  int l, r, mid, p;
  long long x, y, ans, t;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++) scanf("%lld", &a[i]);
  s[0] = 0;
  for (i = 1; i <= n; i++) s[i] = s[i - 1] + a[i];
  x = a[1];
  y = 1;
  while (m--) {
    scanf("%lld", &t);
    if (x + s[n] - s[y] <= t) {
      printf("%d\n", n);
      y = 1;
      x = a[1];
      continue;
    }
    l = y;
    r = n;
    p = n;
    while (l <= r) {
      mid = (l + r) / 2;
      if (x + s[mid] - s[y] >= t) {
        p = min(p, mid);
        r = mid - 1;
      } else
        l = mid + 1;
    }
    x = x + s[p] - s[y] - t;
    y = p;
    if (x == 0) {
      y++;
      x = a[y];
    }
    printf("%d\n", n - y + 1);
  }
  return 0;
}
