#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
const int maxn = 200000 + 10;
inline void read(int &x) {
  int f = 1;
  x = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  x *= f;
}
inline void readll(long long &x) {
  long long f = 1;
  x = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  x *= f;
}
long long n, q;
long long a[maxn], k, Prefix[maxn], last, cur;
void BinarySearch() {
  if (last + k < a[cur]) {
    last += k;
    return;
  }
  long long l = cur, r = n, ans = 0;
  while (l <= r) {
    long long mid = (l + r) >> 1;
    if (Prefix[mid] - Prefix[cur - 1] - last <= k)
      ans = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  if (ans == n) {
    last = 0;
    cur = 1;
    return;
  }
  ans++;
  long long ttt = Prefix[ans] - Prefix[cur - 1] - last - k;
  last = a[ans] - ttt;
  cur = ans;
}
int main() {
  readll(n), readll(q);
  for (long long i = 1; i <= n; i++) {
    readll(a[i]), Prefix[i] = Prefix[i - 1] + a[i];
  }
  last = 0;
  cur = 1;
  for (long long i = 1; i <= q; i++) {
    readll(k);
    BinarySearch();
    printf("%I64d\n", n - cur + 1);
  }
  return 0;
}
