#include <bits/stdc++.h>
using namespace std;
int binarySearch(long long *v, int left, int right, long long target) {
  int mid = (left + right) / 2;
  while (left <= right) {
    if (v[mid] == target) {
      return mid;
    }
    if (v[mid] > target) {
      right = mid - 1;
    } else {
      left = mid + 1;
    }
    mid = (left + right) / 2;
  }
  return right;
}
const int N = 2e5 + 10;
long long sum_strength[N];
long long sum_arrow[N];
int main() {
  int n, q;
  scanf("%d %d", &n, &q);
  long long tmp;
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &tmp);
    sum_strength[i] += sum_strength[i - 1] + tmp;
  }
  for (int i = 1; i <= q; i++) {
    scanf("%lld", &tmp);
    sum_arrow[i] = sum_arrow[i - 1] + tmp;
    if (sum_arrow[i] >= sum_strength[n]) {
      sum_arrow[i] = 0;
    }
  }
  for (int i = 1; i <= q; i++) {
    int index = binarySearch(sum_strength, 0, n, sum_arrow[i]);
    printf("%d\n", n - index);
  }
  return 0;
}
