#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  long long arr[n];
  long long i;
  for (i = 0; i < n; i++) cin >> arr[i];
  for (i = 1; i < n; i++) arr[i] += arr[i - 1];
  long long rem = 0;
  while (k--) {
    long long x;
    cin >> x;
    auto it = lower_bound(arr, arr + n, rem + x);
    if (rem + x >= arr[n - 1]) {
      cout << n << endl;
      rem = 0;
    } else {
      long long x1 = it - arr;
      if (arr[x1] > (rem + x)) {
        cout << n - x1 << endl;
      } else {
        cout << (n - x1 - 1) << endl;
      }
      rem = rem + x;
    }
  }
  return 0;
}
