#include <bits/stdc++.h>
using namespace std;
int n, q, pre[2000100], dem[2000100];
long long a[2000100], b, s[2000100];
void setup() {
  cin >> n >> q;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    a[i + n] = a[i];
  }
  for (int i = 1; i <= n * 2; i++) s[i] = s[i - 1] + a[i];
}
void xuly() {
  for (int i = 1; i <= n * 2; i++) pre[i] = i;
  memset(dem, 0, sizeof(dem));
  cin >> b;
  int j = 1;
  for (int i = n + 1; i <= n * 2; i++) {
    while (s[i] - s[j] > b) j++;
    pre[i] = pre[j];
    dem[i] = dem[j] + 1;
    if (i - pre[j] >= n) {
      cout << dem[i] << "\n";
      return;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  setup();
  for (int i = 1; i <= q; i++) xuly();
  return 0;
}
