#include <bits/stdc++.h>
using namespace std;
unsigned long long int n, q, a[500000];
int main() {
  cin >> n >> q;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    a[i] = a[i] + a[i - 1];
  }
  long long int sum = 0;
  for (int i = 1; i <= q; i++) {
    long long int h;
    cin >> h;
    sum += h;
    if (sum >= a[n]) {
      cout << n << endl;
      sum = 0;
      continue;
    }
    long long int l = 0;
    long long int r = n + 1;
    while (r - l > 1) {
      int m = (r + l) >> 1;
      if (a[m] <= sum)
        l = m;
      else
        r = m;
    }
    if (a[l + 1] <= sum) l++;
    cout << n - l << endl;
  }
}
