#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, q;
  cin >> n >> q;
  vector<long long> arr(n + 1);
  arr[0] = 0;
  for (int i = 1; i <= n; ++i) {
    cin >> arr[i];
    arr[i] += arr[i - 1];
  }
  long long k[q + 1];
  k[0] = 0;
  for (int i = 1; i <= q; ++i) {
    cin >> k[i];
    k[i] += k[i - 1];
  }
  long long low = 0;
  for (int i = 1; i <= q; ++i) {
    int j = lower_bound(arr.begin(), arr.end(), k[i] - k[low]) - arr.begin();
    if ((k[i] - k[low]) < arr[j]) {
      --j;
    }
    if (j >= n) {
      low = i;
      cout << n << endl;
    } else {
      cout << n - j << endl;
    }
  }
}
