#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const int mod = 1e9 + 7;
const double pi = acos(-1);
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  long long arr[N] = {0};
  for (int i = 0; i < n; i++) {
    scanf("%lld", &arr[i]);
    if (i) arr[i] += arr[i - 1];
  }
  long long last = 0;
  while (m--) {
    long long aro;
    scanf("%lld", &aro);
    int low = 0, high = n - 1, mid;
    while (low < high) {
      mid = (low + high + 1) / 2;
      if (arr[mid] - last > aro)
        high = mid - 1;
      else
        low = mid;
    }
    long long rem = n;
    if (arr[high] - last <= aro) rem = n - high - 1;
    last += aro;
    if (high == n - 1) {
      rem = n;
      last = 0;
    }
    printf("%lld\n", rem);
  }
  return 0;
}
