#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout.precision(18);
  int t;
  t = 1;
  while (t--) {
    int n, q;
    cin >> n >> q;
    vector<long long int> a(n);
    vector<long long int> b(q);
    for (int i = 0; i < n; i++) cin >> a[i];
    for (int i = 0; i < q; i++) cin >> b[i];
    vector<long long int> c(n);
    c[0] = a[0];
    long long sum1 = 0;
    for (int i = 1; i < n; i++) c[i] = a[i] + c[i - 1];
    for (int i = 0; i < q; i++) {
      sum1 = sum1 + b[i];
      std::vector<long long int>::iterator lower;
      lower = std::lower_bound(c.begin(), c.end(), sum1);
      if (lower == c.end()) {
        sum1 = 0;
        cout << n << endl;
      } else {
        int l = lower - c.begin();
        if (sum1 == c[l]) l++;
        if (sum1 == c[n - 1]) {
          sum1 = 0;
          cout << n << endl;
        } else
          cout << n - l << endl;
      }
    }
  }
  return 0;
}
