#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 150000 + 2;
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long> v(n + 1, 0);
  for (int i = 1; i <= n; i++) {
    long long x;
    cin >> x;
    v[i] = v[i - 1] + x;
  }
  long long cur = 0;
  for (int i = 1; i <= m; i++) {
    long long x;
    cin >> x;
    cur += x;
    int l = 1;
    int r = n;
    while (r - l > 1) {
      int mid = (r + l) / 2;
      if (v[mid] < cur)
        l = mid + 1;
      else
        r = mid;
    }
    if (r == l) {
      if (r == n) {
        if (v[r] <= cur) {
          cout << n << endl;
          cur = 0;
        } else {
          cout << n - r + 1 << endl;
        }
      } else {
        if (v[r] <= cur) {
          cout << n - r << endl;
        } else {
          cout << n - r + 1 << endl;
        }
      }
    } else {
      if (v[l] > cur) {
        cout << n - l + 1 << endl;
      } else if (v[r] > cur) {
        cout << n - r + 1 << endl;
      } else if (v[r] <= cur) {
        if (r == n) {
          cout << n << endl;
          cur = 0;
        } else {
          cout << n - r << endl;
        }
      }
    }
  }
  return 0;
}
