#include <bits/stdc++.h>
using namespace std;
long long int a[200001];
long long int q[200001];
long long int pre[200001];
long long int binarysearch(long long int n, long long int p) {
  long long int low = 1, high = n;
  while (low <= high) {
    long long int mid = (low + high) / 2;
    if (pre[mid] <= p)
      low = mid + 1;
    else
      high = mid - 1;
  }
  return high;
}
int main() {
  long long int n, q1;
  cin >> n >> q1;
  for (long long int i = 1; i <= n; i++) cin >> a[i];
  for (long long int i = 1; i <= q1; i++) cin >> q[i];
  pre[1] = a[1];
  for (long long int i = 2; i <= n; i++) pre[i] = a[i] + pre[i - 1];
  long long int cal = 0;
  for (long long int i = 1; i <= q1; i++) {
    long long int ser = q[i] + cal;
    long long int ans = binarysearch(n, ser);
    if (ans < n)
      cout << n - ans << "\n";
    else
      cout << n << "\n";
    cal += q[i];
    if (ans == n) cal = 0;
  }
  return 0;
}
