#include <bits/stdc++.h>
#define rf(x) (x)=0;while(*p<48)p++;while(47<*p)(x)=((x)<<3)+((x)<<1)+(*p++&15);
//#define rf(x) (x)=0;while(*p<48)im=*p=='-';while(47<*p)(x)=((x)<<3)+((x)<<1)+(*p++&15);if(im)(x)=-(x);
#define pb push_back
#define eb emplace_back
#define sz(V) ((int)(V).size())
#define allv(V) ((V).begin()),((V).end())
#define befv(V) ((V)[(sz(V)-2)])
#define sorv(V) sort(allv(V))
#define revv(V) reverse(allv(V))
#define univ(V) (V).erase(unique(allv(V)),(V).end())
#define clv(V) (V).clear()
#define upmin(a,b) (a)=min((a),(b))
#define upmax(a,b) (a)=max((a),(b))
#define rb(x) ((x)&(-(x)))
#define cb(x) (x)=(!(x))
#define INF (0x3f3f3f3f)
#define INFLL (0x3f3f3f3f3f3f3f3fll)
#define INFST (0x7f7f7f7f)
#define INFLLST (0x7f7f7f7f7f7f7f7fll)
using namespace std;
typedef long long ll;
typedef __int128_t lll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, ll> pil;
typedef pair<ll, int> pli;
typedef pair<ld, ld> pdd;
typedef complex<ld> base;
const ld EPS = (ld)1e-7;
const ld PI = acos(0) * 2;
bool isZero(const ld& x) { return abs(x) <= EPS; }
int sign(const ld& x) { return isZero(x) ? 0 : (0 < x ? 1 : -1); }
ll gcd(ll a, ll b) { for(;b;a%=b,swap(a,b)){} return abs(a); }
pll operator + (const pll& a, const pll& b) { return pll(a.first+b.first, a.second+b.second); }
pll operator - (const pll& a, const pll& b) { return pll(a.first-b.first, a.second-b.second); }
pll operator * (const pll& a, const ll& b) { return pll(a.first*b, a.second*b); }
ll operator * (const pll& a, const pll& b) { return a.first*b.second - b.first*a.second; }
ll ccw(const pll& a, const pll& b, const pll& c) { return a*b + b*c + c*a; }
int rd(int s, int e) { return rand()%(e-s+1) + s; }
void fg(vector<int> G[], int a, int b) { G[a].pb(b); G[b].pb(a); }
void fg(vector<pii> G[], int a, int b, int c) { G[a].pb({b, c}); G[b].pb({a, c}); }

const int MAXN = 100005;
const int MAXQ = 100005;

priority_queue<pil> PQ;

vector<pil> G[MAXQ];
ll A[MAXQ];

ll Ans[MAXN];

int N, NN, Q;

void f(vector<pil> &V, ll b) {
	//printf("F b=%lld, N=%d\n", b, N);
	if(!b) return;
	if(b <= N) {
		V.eb(-1, b);
		return;
	}
	int x = (int)(upper_bound(A, A+Q+1, b)-A) - 1;
	V.eb(x, b / A[x]);
	f(V, b % A[x]);
}

int main() {
	ios::sync_with_stdio(false);

	cin >> N >> Q;
	if(!Q) {
		for(int i = 1; i <= N; i++) puts("1");
		return 0;
	}

	{
		int qn = 0;
		for(int i = 1; i <= Q; i++) {
			ll x; cin >> x;
			for(; qn && x <= A[qn]; qn--);
			A[++qn] = x;
		}
		Q = qn;
	}

	NN = N;
	if(A[1] <= N) {
		N = A[1];
		for(int i = 2; i <= Q; i++) A[i-1] = A[i];
		Q--;
	}
	A[0] = N;

	if(!Q) {
		for(int i = 1; i <= N; i++) puts("1");
		for(int i = N+1; i <= NN; i++) puts("0");
		return 0;
	}

/*
	printf("N=%d, NN=%d, Q=%d\n", N, NN, Q);
	for(int i = 0; i <= Q; i++)
		printf("%d : %lld\n", i, A[i]);
*/

	for(int i = 1; i <= Q; i++) {
		ll r = A[i] % A[i-1];
		f(G[i], r);
	}

	PQ.push(pil(Q, 1));

	for(; !PQ.empty() && 0 < PQ.top().first;) {
		int qi = PQ.top().first;
		ll qc = 0;
		for(; !PQ.empty() && PQ.top().first == qi; PQ.pop())
			qc += PQ.top().second;

		//printf("qi=%d, qc=%lld\n", qi, qc);

		ll a = A[qi] / A[qi-1];
		PQ.push(pil(qi-1, qc * a));

		for(auto &v : G[qi]) {
			if(0 <= v.first)
				PQ.push(pil(v.first, v.second * qc));
			else Ans[v.second] += qc;
		}
	}

	for(; !PQ.empty();) {
		int qi; ll qc; tie(qi, qc) = PQ.top(); PQ.pop();
		if(!qi) Ans[N] += qc;
		else Ans[qc]++;
	}

	for(int i = N-1; i; i--) Ans[i] += Ans[i+1];

	for(int i = 1; i <= N; i++) printf("%lld\n", Ans[i]);
	for(int i = N+1; i <= NN; i++) puts("0");

	return 0;
}

Measured memory_bytes: 34920