#include <bits/stdc++.h>
using namespace std;
long long int com[200002];
int main() {
  int n, q;
  cin >> n >> q;
  long long *w = new long long[n];
  long long *m = new long long[q];
  for (int i = 0; i < n; i++) {
    cin >> w[i];
    if (i == 0)
      com[i] = w[i];
    else
      com[i] = com[i - 1] + w[i];
  }
  long long int sum = 0;
  int pos = 0;
  for (int i = 0; i < q; i++) {
    cin >> m[i];
    sum += m[i];
    pos = upper_bound(com, com + n, sum) - com;
    if (pos == n) {
      sum = 0;
      pos = 0;
    }
    cout << n - pos << endl;
  }
}
