#include <bits/stdc++.h>
using namespace std;
long long int mod = 1e9 + 7;
int main() {
  long long int T = 1;
  while (T--) {
    long long int N, Q;
    cin >> N >> Q;
    long long int arr[N];
    for (long long int i = 0; i < N; i++) {
      cin >> arr[i];
    }
    for (long long int i = 1; i < N; i++) {
      arr[i] = arr[i - 1] + arr[i];
    }
    long long int pre_q = 0;
    while (Q--) {
      long long int q;
      cin >> q;
      pre_q += q;
      if (pre_q >= arr[N - 1]) {
        pre_q = 0;
      }
      long long int up = upper_bound(arr, arr + N, pre_q) - arr;
      cout << N - up << endl;
    }
  }
  return 0;
}
