#include <bits/stdc++.h>
using namespace std;
const int maxn = 2 * 1e5 + 5;
long long sum[maxn];
int a[maxn];
long long q[maxn];
int main() {
  int n, m;
  while (~scanf("%d%d", &n, &m)) {
    for (int i = 0; i < n; i++) {
      scanf("%d", a + i);
      if (i == 0)
        sum[i] = a[i];
      else
        sum[i] = sum[i - 1] + (long long)a[i];
    }
    for (int i = 0; i < m; i++) scanf("%lld", q + i);
    vector<int> ans;
    long long sum1 = 0;
    for (int i = 0; i < m; i++) {
      sum1 += q[i];
      int temp;
      if (sum1 >= sum[n - 1]) {
        temp = 0;
        sum1 = 0;
      } else {
        temp = lower_bound(sum, sum + n, sum1) - sum + 1;
        if (sum[temp - 1] > sum1) temp--;
      }
      temp = n - temp;
      ans.push_back(temp);
    }
    for (int i = 0; i < ans.size(); i++) printf("%d\n", ans[i]);
  }
}
