#include <bits/stdc++.h>
using namespace std;
long long n, q, a, qzh[200005], d = 0, p, sumk = 0;
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> q;
  for (int i = 1; i <= n; i++) {
    cin >> a;
    qzh[i] = qzh[i - 1] + a;
  }
  for (int i = 1; i <= q; i++) {
    cin >> d;
    sumk += d;
    p = lower_bound(qzh + 1, qzh + n + 1, sumk) - qzh;
    if (qzh[p] > sumk) p--;
    if (p >= n) {
      cout << n << endl;
      sumk = 0;
    } else
      cout << n - p << endl;
  }
  return 0;
}
