#include <bits/stdc++.h>
using namespace std;
template <typename T, typename D>
std::ostream& operator<<(std::ostream& os, const std::pair<T, D>& p) {
  return os << "(" << p.first << ", " << p.second << ")";
}
vector<long long> s;
long long add(long long l, long long r) { return s[r + 1] - s[l]; }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  long long q;
  cin >> q;
  vector<long long> av(n);
  for (int i = (0); i < (n); i++) cin >> av[i];
  s.resize(n + 1);
  s[0] = 0;
  for (int i = (0); i < (n); i++) s[i + 1] = av[i] + s[i];
  vector<long long> kv(q);
  for (int i = (0); i < (q); i++) cin >> kv[i];
  long long cur_i = 0;
  long long cur_health = av[0];
  for (auto& k : kv) {
    if (k >= cur_health) {
      long long l = cur_i;
      long long r = n;
      while (r - l > 1) {
        long long m = (l + r) / 2;
        long long killer_arrows = cur_health + add(cur_i + 1, m);
        if (k >= killer_arrows) {
          l = m;
        } else {
          r = m;
        }
      }
      if (l == n - 1) {
        cur_i = 0;
        cur_health = av[0];
      } else {
        long long killer_arrows = cur_health + add(cur_i + 1, l);
        cur_i = l + 1;
        cur_health = av[cur_i] - (k - killer_arrows);
      }
    } else {
      cur_health -= k;
    }
    cout << n - cur_i << "\n";
  }
}
