#include <bits/stdc++.h>
using namespace std;
vector<long long> vt;
long long a[200100], b[200100];
int main() {
  long long n, m;
  scanf("%lld %lld", &n, &m);
  for (int i = 1; i <= n; i++) {
    long long q;
    scanf("%lld", &q);
    a[i] = a[i - 1] + q;
  }
  for (int i = 1; i <= n; i++) {
    vt.push_back(a[i]);
  }
  long long ch = 1;
  long long nam = 0;
  for (int y = 0; y < m; y++) {
    scanf("%lld", &b[y]);
  }
  long long gap = 0;
  for (int i = 0; i < m; i++) {
    ch = upper_bound(vt.begin(), vt.end(), b[i] + gap) - vt.begin();
    gap += b[i];
    if (ch == n) {
      printf("%lld\n", n);
      gap = 0;
    } else {
      printf("%lld\n", n - ch);
    }
  }
}
