#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000 * 1000 + 10;
long long dp_warriors[MAXN];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, q;
  cin >> n >> q;
  cin >> dp_warriors[0];
  for (int i = 1; i < n; i++) {
    long long a;
    cin >> a;
    dp_warriors[i] = a + dp_warriors[i - 1];
  }
  long long last = 0;
  for (int i = 0; i < q; i++) {
    long long query;
    cin >> query;
    last += query;
    query = last;
    int pointer =
        upper_bound(dp_warriors, dp_warriors + n, query) - dp_warriors - 1;
    if (pointer == n - 1) {
      last = 0;
      pointer = -1;
    }
    cout << n - pointer - 1 << endl;
  }
  return 0;
}
