You are given an integer sequence of length n+1, a_1,a_2,...,a_{n+1}, which consists of the n integers 1,...,n.
It is known that each of the n integers 1,...,n appears at least once in this sequence.
For each integer k=1,...,n+1, find the number of the different subsequences (not necessarily contiguous) of the given sequence with length k, modulo 10^9+7.

-----Notes-----
 - If the contents of two subsequences are the same, they are not separately counted even if they originate from different positions in the original sequence.
 - A subsequence of a sequence a with length k is a sequence obtained by selecting k of the elements of a and arranging them without changing their relative order. For example, the sequences 1,3,5 and 1,2,3 are subsequences of 1,2,3,4,5, while 3,1,2 and 1,10,100 are not.

-----Constraints-----
 - 1 \leq n \leq 10^5
 - 1 \leq a_i \leq n
 - Each of the integers 1,...,n appears in the sequence.
 - n and a_i are integers.

-----Input-----
Input is given from Standard Input in the following format:
n
a_1 a_2 ... a_{n+1}

-----Output-----
Print n+1 lines.
The k-th line should contain the number of the different subsequences of the given sequence with length k, modulo 10^9+7.

-----Sample Input-----
3
1 2 1 3

-----Sample Output-----
3
5
4
1

There are three subsequences with length 1: 1 and 2 and 3.
There are five subsequences with length 2: 1,1 and 1,2 and 1,3 and 2,1 and 2,3.
There are four subsequences with length 3: 1,1,3 and 1,2,1 and 1,2,3 and 2,1,3.
There is one subsequence with length 4: 1,2,1,3.

Difficulty: MEDIUM

Solutions:
import math
from collections import deque
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
s = set()
for i in range(n + 1):
	if a[i] not in s:
		s.add(a[i])
	else:
		q = i
p = a.index(a[q])
q = n - q
Mod = 10 ** 9 + 7
M = n + 2
fac = [0] * M
finv = [0] * M
inv = [0] * M

def COMinit():
	fac[0] = fac[1] = 1
	finv[0] = finv[1] = 1
	inv[1] = 1
	for i in range(2, M):
		fac[i] = fac[i - 1] * i % Mod % Mod
		inv[i] = Mod - inv[Mod % i] * (Mod // i) % Mod
		finv[i] = finv[i - 1] * inv[i] % Mod % Mod

def COM(n, k):
	if n < k:
		return 0
	if n < 0 or k < 0:
		return 0
	return fac[n] * (finv[k] * finv[n - k] % Mod) % Mod % Mod
COMinit()
for i in range(1, n + 2):
	print((COM(n + 1, i) - COM(p + q, i - 1)) % Mod)


class nCrMod:

	def __init__(self, mod):
		self.mod = mod
		self.fac = [1, 1]
		self.finv = [1, 1]
		self.inv = [0, 1]

	def prep(self, n):
		mod = self.mod
		(f, fi) = (self.fac[-1], self.finv[-1])
		for i in range(len(self.fac), n + 1):
			fn = f * i % mod
			v = -self.inv[mod % i] * (mod // i) % mod
			fin = fi * v % mod
			(f, fi) = (fn, fin)
			self.fac.append(f)
			self.finv.append(fi)
			self.inv.append(v)

	def __call__(self, n, r):
		if len(self.fac) <= n:
			self.prep(n)
		return self.fac[n] * self.finv[r] * self.finv[n - r] % self.mod

def main():
	N = int(input())
	A = list(map(int, input().split()))
	d = {}
	(f, s) = (0, 0)
	for (i, a) in enumerate(A):
		if a in d:
			break
		d[a] = i
	(f, s) = (d[a], i)
	mod = 10 ** 9 + 7
	nCr = nCrMod(mod)
	for i in range(1, N + 2):
		if i > N + 1 - (s - f):
			print(nCr(N + 1, i))
		else:
			print((nCr(N + 1, i) - nCr(N - (s - f), i - 1)) % mod)
main()


from math import factorial as f
from collections import Counter as co
n = int(input())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7
d = co(a)
keys = [k for (k, v) in d.items() if v == 2]
dbl = keys[0]
ll = [i for (i, x) in enumerate(a) if x == dbl]
b = ll[1] - ll[0]
m = n - b

def pf(x, y, p):
	if y == 0:
		return 1
	if y % 2 == 0:
		d = pf(x, y // 2, p)
		return d * d % p
	if y % 2 == 1:
		return x * pf(x, y - 1, p) % p
facl = [1]
for i in range(1, n + 2):
	facl.append(facl[i - 1] * i % mod)
invl = [1] * (n + 2)
for i in range(1, n + 2):
	invl[i] = pf(facl[i], mod - 2, mod)

def comb(x, k, p):
	if x < 0 or k < 0 or x < k:
		return 0
	if x == 0 or k == 0:
		return 1
	return facl[x] * invl[k] * invl[x - k] % mod
for k in range(1, n + 2):
	print((comb(n + 1, k, mod) - comb(m, k - 1, mod)) % mod)


import itertools
N = int(input())
A = list(map(int, input().split()))
MOD = 10 ** 9 + 7
MAX_NUM = 10 ** 5 + 10

def inv_mod(n):
	return pow(n, MOD - 2, MOD)
FACTS = [1 for _ in range(MAX_NUM + 1)]
for n in range(1, MAX_NUM + 1):
	FACTS[n] = n * FACTS[n - 1] % MOD
INV_FACTS = [1 for _ in range(MAX_NUM + 1)]
INV_FACTS[MAX_NUM] = inv_mod(FACTS[MAX_NUM])
for n in range(MAX_NUM - 1, -1, -1):
	INV_FACTS[n] = INV_FACTS[n + 1] * (n + 1) % MOD
for i in range(MAX_NUM + 1):
	assert FACTS[i] * INV_FACTS[i] % MOD == 1

def ncr(n, r):
	if r > n:
		return 0
	if r < 0:
		return 0
	ans = FACTS[n] * INV_FACTS[n - r] * INV_FACTS[r]
	return ans % MOD
from collections import defaultdict
v2i = defaultdict(list)
for (i, v) in enumerate(A):
	v2i[v].append(i)
(fst, snd) = (-1, -1)
for v in v2i:
	if len(v2i[v]) == 2:
		(fst, snd) = v2i[v]
K = snd - fst - 1
for ell in range(1, N + 2):
	ans = ncr(N + 1, ell) - ncr(N - 1 - K, ell - 1)
	print(ans % MOD)


n = int(input())
al = list(map(int, input().split()))
MOD = 10 ** 9 + 7
N = 10 ** 5 + 1
fact = [1] * (N + 1)
rfact = [1] * (N + 1)
r = 1
for i in range(1, N + 1):
	fact[i] = r = r * i % MOD
rfact[N] = r = pow(fact[N], MOD - 2, MOD)
for i in range(N, 0, -1):
	rfact[i - 1] = r = r * i % MOD

def perm(n, k):
	return fact[n] * rfact[n - k] % MOD

def comb(n, k):
	return fact[n] * rfact[k] * rfact[n - k] % MOD
from collections import defaultdict
dic = defaultdict(int)
for (idx, a) in enumerate(al):
	if dic[a] == 1:
		e = idx
		v = a
	dic[a] += 1
for (idx, a) in enumerate(al):
	if a == v:
		s = idx
		break
for i in range(1, n + 2):
	ans = comb(n + 1, i)
	if s + n - e >= i - 1:
		ans -= comb(s + (n - e), i - 1)
	ans %= MOD
	print(ans)


MOD = 10 ** 9 + 7
U = 10 ** 5 + 1

def power_mod(a, n):
	if n == 0:
		return 1
	x = power_mod(a, n // 2) ** 2 % MOD
	return x if n % 2 == 0 else a * x % MOD

def make_fact(fact, fact_inv):
	for i in range(1, U + 1):
		fact[i] = fact[i - 1] * i % MOD
	fact_inv[U] = power_mod(fact[U], MOD - 2)
	for i in range(U, 0, -1):
		fact_inv[i - 1] = fact_inv[i] * i % MOD

def comb(n, k):
	if k < 0 or k > n:
		return 0
	x = fact[n]
	x *= fact_inv[k]
	x %= MOD
	x *= fact_inv[n - k]
	x %= MOD
	return x
fact = [1] * (U + 1)
fact_inv = [1] * (U + 1)
make_fact(fact, fact_inv)
n = int(input())
A = [int(x) for x in input().split()]
memo = dict()
d = 0
for (i, x) in enumerate(A):
	if x in memo:
		d = i - memo[x]
		break
	memo[x] = i
rest = n - d
for k in range(1, n + 2):
	ans = comb(n + 1, k) - comb(rest, k - 1)
	ans %= MOD
	print(ans)


n = int(input()) + 1
a = list(map(int, input().split()))
mod = 10 ** 9 + 7
d = [False] * (n + 1)
left = right = 0
for i in range(n):
	if d[a[i]]:
		right = i
		left = a.index(a[i])
		break
	d[a[i]] = True
fac = [1] * (n + 1)
for i in range(1, n + 1):
	fac[i] = fac[i - 1] * i % mod

def inv(x):
	return pow(x, mod - 2, mod)

def c(n, k):
	if n < 0 or k < 0 or n < k:
		return 0
	return fac[n] * inv(fac[n - k] * fac[k] % mod) % mod
left_len = left
right_len = n - right - 1
print(n - 1)
for i in range(2, n + 1):
	ans = c(n, i) - c(left_len + right_len, i - 1)
	print(ans % mod)


import collections
mod = 10 ** 9 + 7
fac = [1]
caf = [1]
n = int(input())

def pow(n, p):
	res = 1
	while p > 0:
		if p % 2 == 0:
			n = n ** 2 % mod
			p //= 2
		else:
			res = res * n % mod
			p -= 1
	return res % mod
for i in range(1, n + 2):
	fac.append(fac[i - 1] * i % mod)
	caf.append(pow(fac[i], mod - 2) % mod)

def ncr(n, r):
	if n < r:
		return 0
	return fac[n] * caf[r] * caf[n - r]

def main():
	global n
	a = list(map(int, input().split()))
	ca = collections.Counter(a)
	tyo = ca.most_common()[0][0]
	kaburi = [i for (i, x) in enumerate(a) if x == tyo]
	for i in range(1, n + 2):
		print((ncr(n + 1, i) - ncr(n + 1 - (kaburi[1] - kaburi[0] + 1), i - 1)) % mod)
main()


from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heapify
from bisect import bisect_left, bisect_right
import sys, math, itertools, fractions, pprint
sys.setrecursionlimit(10 ** 8)
mod = 10 ** 9 + 7
INF = float('inf')

def inp():
	return int(sys.stdin.readline())

def inpl():
	return list(map(int, sys.stdin.readline().split()))
n = inp()
a = inpl()
s = set()
for i in range(n + 1):
	if a[i] in s:
		last = n - i
		t = a[i]
		break
	s.add(a[i])
for i in range(n + 1):
	if a[i] == t:
		fir = i
		break
soto = fir + last

class Combination:

	def __init__(self, n_max, mod=10 ** 9 + 7):
		self.mod = mod
		self.modinv = self.make_modinv_list(n_max)
		(self.fac, self.facinv) = self.make_factorial_list(n_max)

	def __call__(self, n, r):
		return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n - r] % self.mod

	def make_factorial_list(self, n):
		fac = [1]
		facinv = [1]
		for i in range(1, n + 1):
			fac.append(fac[i - 1] * i % self.mod)
			facinv.append(facinv[i - 1] * self.modinv[i] % self.mod)
		return (fac, facinv)

	def make_modinv_list(self, n):
		modinv = [0] * (n + 1)
		modinv[1] = 1
		for i in range(2, n + 1):
			modinv[i] = self.mod - self.mod // i * modinv[self.mod % i] % self.mod
		return modinv
comb = Combination(2 * 10 ** 5 + 10)
for i in range(1, n + 2):
	rm = 0
	if i <= soto + 1:
		rm = comb(soto, i - 1)
	print((comb(n + 1, i) - rm) % mod)


from collections import Counter
U = 10 ** 5 + 1
MOD = 10 ** 9 + 7
fact = [1] * (U + 1)
fact_inv = [1] * (U + 1)
for i in range(1, U + 1):
	fact[i] = fact[i - 1] * i % MOD
fact_inv[U] = pow(fact[U], MOD - 2, MOD)
for i in range(U, 0, -1):
	fact_inv[i - 1] = fact_inv[i] * i % MOD

def comb(n, k):
	if k < 0 or k > n:
		return 0
	z = fact[n]
	z *= fact_inv[k]
	z %= MOD
	z *= fact_inv[n - k]
	z %= MOD
	return z
n = int(input())
A = list(map(int, input().split()))
x = Counter(A).most_common()[0][0]
left = A.index(x)
right = A[::-1].index(x)
for k in range(1, n + 2):
	ans = comb(n + 1, k) - comb(left + right, k - 1)
	ans %= MOD
	print(ans)


N = int(input())
A = list(map(int, input().split()))
MOD = 10 ** 9 + 7
from collections import Counter
ctr = Counter(A)
dup = ctr.most_common()[0][0]
i = A.index(dup)
j = A[::-1].index(dup)
l = i + j
MAXN = N + 5
fac = [1, 1] + [0] * MAXN
finv = [1, 1] + [0] * MAXN
inv = [0, 1] + [0] * MAXN
for i in range(2, MAXN + 2):
	fac[i] = fac[i - 1] * i % MOD
	inv[i] = -inv[MOD % i] * (MOD // i) % MOD
	finv[i] = finv[i - 1] * inv[i] % MOD

def comb(n, r):
	if n < r:
		return 0
	if n < 0 or r < 0:
		return 0
	return fac[n] * (finv[r] * finv[n - r] % MOD) % MOD
ans = []
for k in range(1, N + 2):
	ans.append(comb(N + 1, k))
for k in range(l + 1):
	ans[k] -= comb(l, k)
	ans[k] %= MOD
print(*ans, sep='\n')


from collections import Counter
N = int(input())
A = list(map(int, input().split()))
c = Counter(A).most_common(1)[0][0]
B = []
mod = 10 ** 9 + 7
for i in range(N + 1):
	if A[i] == c:
		B.append(i)
(F, I) = ([1], [1])
for i in range(1, N + 2):
	F.append(F[i - 1] * i % mod)
	I.append(pow(F[i], mod - 2, mod))

def C(n, r):
	if n < r or n == 0 or r == 0:
		return 0
	else:
		return F[n] * I[r] * I[n - r] % mod
r0 = B[0] + N - B[1]
for i in range(1, N + 2):
	Ans = (C(N + 1, i) - C(r0, i - 1)) % mod
	print(Ans if i > 1 else Ans - 1)


import sys
from collections import Counter
sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7

class CmbMod:

	def __init__(self, n, p):
		self.n = n
		self.p = p
		self.fact = [1, 1]
		self.factinv = [1, 1]
		self.inv = [0, 1]

	def cmb_mod(self, n, r):
		(numer, denom) = (1, 1)
		for i in range(r):
			numer = numer * (n - i) % self.p
			denom = denom * (i + 1) % self.p
		return numer * pow(denom, self.p - 2, self.p) % self.p

	def prep(self):
		for i in range(2, self.n + 1):
			self.fact.append(self.fact[-1] * i % self.p)
			self.inv.append(-self.inv[self.p % i] * (self.p // i) % self.p)
			self.factinv.append(self.factinv[-1] * self.inv[-1] % self.p)

	def cmb_mod_with_prep(self, n, r):
		if r < 0 or n < r:
			return 0
		r = min(r, n - r)
		return self.fact[n] * self.factinv[r] * self.factinv[n - r] % self.p

def resolve():
	n = int(input())
	A = list(map(int, input().split()))
	D = Counter(A)
	dup = 0
	for (k, v) in list(D.items()):
		if v == 2:
			dup = k
			break
	flg = 1
	(right, left) = (0, 0)
	for i in range(n + 1):
		if flg and A[i] == dup:
			left = i
			flg ^= 1
		elif A[i] == dup:
			right = i
			break
	remain = n - (right - left)
	cmb = CmbMod(n + 1, mod)
	cmb.prep()
	for i in range(1, n + 2):
		res = cmb.cmb_mod_with_prep(n + 1, i) - cmb.cmb_mod_with_prep(remain, i - 1)
		print(res % mod)

def __starting_point():
	resolve()
__starting_point()


n = int(input())
alist = list(map(int, input().split()))
MOD = 10 ** 9 + 7
inv_table = [0] + [1]
for i in range(2, n + 2):
	inv_table.append(-(MOD // i) * inv_table[MOD % i] % MOD)
dic_a = {}
same_pair = None
for i in range(n + 1):
	if alist[i] in dic_a:
		same_pair = (dic_a[alist[i]], i)
		break
	else:
		dic_a[alist[i]] = i
pair_diff = n - (same_pair[1] - same_pair[0])
(comb1, comb2) = (1, 1)
for r in range(1, n + 2):
	comb1 *= (n - r + 2) * inv_table[r]
	comb1 %= MOD
	print((comb1 - comb2) % MOD)
	comb2 *= (pair_diff - r + 1) * inv_table[r]
	comb2 %= MOD


def cmb(N, r, mod):
	if r < 0 or r > N:
		return 0
	r = min(r, N - r)
	return g1[N] * g2[r] * g2[N - r] % mod
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]
mod = 10 ** 9 + 7
n = int(input())
lis = list(map(int, input().split()))
li = [-1] * n
for i in range(2, n + 2):
	g1.append(g1[-1] * i % mod)
	inverse.append(-inverse[mod % i] * (mod // i) % mod)
	g2.append(g2[-1] * inverse[-1] % mod)
for i in range(n + 1):
	if li[lis[i] - 1] != -1:
		left = li[lis[i] - 1] + 1
		right = i + 1
		break
	else:
		li[lis[i] - 1] = i
for k in range(1, n + 2):
	ans = cmb(n + 1, k, mod) - cmb(left + n - right, k - 1, mod)
	if ans < 0:
		ans += mod
	print(ans)


mod = 10 ** 9 + 7
SIZE = 10 ** 5 + 5
fact = [0] * SIZE
inv = [0] * SIZE
finv = [0] * SIZE
(fact[0], fact[1]) = (1, 1)
inv[1] = 1
(finv[0], finv[1]) = (1, 1)
for i in range(2, SIZE):
	fact[i] = fact[i - 1] * i % mod
	inv[i] = mod - inv[mod % i] * (mod // i) % mod
	finv[i] = finv[i - 1] * inv[i] % mod

def nCr(n, r):
	if n < 0 or r < 0 or n < r:
		return 0
	return fact[n] * (finv[r] * finv[n - r] % mod) % mod
from collections import Counter
n = int(input())
A = list(map(int, input().split()))
counterA = Counter(A)
duplicate = 0
for (num, count) in counterA.items():
	if count == 2:
		duplicate = num
		break
duplicate_pos = []
for (i, a) in enumerate(A):
	if a == duplicate:
		duplicate_pos.append(i)
(first, second, *_) = duplicate_pos
for k in range(1, n + 2):
	base = nCr(n + 1, k)
	duplicate_pattern = nCr(first + n - second, k - 1)
	print((base - duplicate_pattern) % mod)


from collections import Counter

class Combination:

	def __init__(self, size):
		self.size = size + 2
		self.fact = [1, 1] + [0] * size
		self.factInv = [1, 1] + [0] * size
		self.inv = [0, 1] + [0] * size
		for i in range(2, self.size):
			self.fact[i] = self.fact[i - 1] * i % MOD
			self.inv[i] = -self.inv[MOD % i] * (MOD // i) % MOD
			self.factInv[i] = self.factInv[i - 1] * self.inv[i] % MOD

	def npr(self, n, r):
		if n < r or n < 0 or r < 0:
			return 0
		return self.fact[n] * self.factInv[n - r] % MOD

	def ncr(self, n, r):
		if n < r or n < 0 or r < 0:
			return 0
		return self.fact[n] * (self.factInv[r] * self.factInv[n - r] % MOD) % MOD

	def nhr(self, n, r):
		return self.ncr(n + r - 1, n - 1)
N = int(input())
A = list(map(int, input().split()))
MOD = 10 ** 9 + 7
comb = Combination(N + 100)
cntA = Counter(A)
X = [a for (a, c) in cntA.items() if c == 2][0]
(l, r) = [i for (i, a) in enumerate(A) if a == X]
ans = [N]
for leng in range(2, N + 2):
	M = comb.ncr(N + 1, leng)
	L = l + (N - r)
	D = comb.ncr(L, leng - 1)
	ans.append((M - D) % MOD)
print(*ans, sep='\n')


MOD = 10 ** 9 + 7

def prepare(n):
	global MOD
	modFacts = [0] * (n + 1)
	modFacts[0] = 1
	for i in range(n):
		modFacts[i + 1] = modFacts[i] * (i + 1) % MOD
	invs = [1] * (n + 1)
	invs[n] = pow(modFacts[n], MOD - 2, MOD)
	for i in range(n, 1, -1):
		invs[i - 1] = invs[i] * i % MOD
	return (modFacts, invs)
N = int(input())
place = [0] * N
A = list(map(int, input().split()))
for (i, s) in enumerate(A):
	if place[s - 1] == 0:
		place[s - 1] = i + 1
	else:
		a = place[s - 1]
		b = i + 1
		break
(modFacts, invs) = prepare(N + 1)
cnt = pow(2, N + 1, MOD) - 1
cnt -= pow(2, a - 1, MOD) * pow(2, N + 1 - b, MOD)
la = a - 1
rb = N + 1 - b
t = la + rb
for k in range(1, N + 2):
	cnt = modFacts[N + 1] * invs[k] * invs[N + 1 - k] % MOD
	if t >= k - 1:
		cnt -= modFacts[t] * invs[k - 1] * invs[t - (k - 1)]
	print(cnt % MOD)


from collections import Counter
(n, *a) = map(int, open(0).read().split())
n += 1

def cmb(n, r, mod):
	if r < 0 or r > n:
		return 0
	r = min(r, n - r)
	return g1[n] * g2[r] * g2[n - r] % mod
mod = 10 ** 9 + 7
N = n
g1 = [0] * (N + 1)
g1[0] = 1
g1[1] = 1
g2 = [0] * (N + 1)
g2[0] = 1
g2[1] = 1
inverse = [0] * (N + 1)
inverse[0] = 0
inverse[1] = 1
for i in range(2, N + 1):
	g1[i] = g1[i - 1] * i % mod
	inverse[i] = -inverse[mod % i] * (mod // i) % mod
	g2[i] = g2[i - 1] * inverse[i] % mod
d = Counter(a).most_common(1)[0][0]
lr = [i for (i, e) in enumerate(a) if e == d]
l = lr[1] - lr[0] + 1
answer = [(cmb(n, i, mod) - cmb(n - l, i - 1, mod)) % mod for i in range(1, n + 1)]
print('\n'.join(map(str, answer)))


mod = 10 ** 9 + 7
fact = [1] * (10 ** 5 + 2)
for n in range(1, 10 ** 5 + 2):
	fact[n] = n * fact[n - 1] % mod

def comb(n, k):
	return fact[n] * pow(fact[k], mod - 2, mod) * pow(fact[n - k], mod - 2, mod) % mod
N = int(input())
a = list(map(int, input().split()))
c = [-1] * N
for j in range(N + 1):
	if c[a[j] - 1] != -1:
		break
	c[a[j] - 1] = j
i = c[a[j] - 1]
j = N - j
for k in range(1, N + 2):
	ans = comb(N + 1, k)
	if k - 1 <= i + j:
		ans -= comb(i + j, k - 1)
	print(ans % mod)


N = int(input())
P = 10 ** 9 + 7
A = [int(i) for i in input().split()]
B = [-1 for i in range(N)]
s = (-1, -1)
for i in range(N + 1):
	if B[A[i] - 1] == -1:
		B[A[i] - 1] = i
	else:
		s = (B[A[i] - 1], i)
		break
M = N - s[1] + s[0] + 1

def egcd(a, b):
	(x, lastx) = (0, 1)
	(y, lasty) = (1, 0)
	while b != 0:
		q = a // b
		(a, b) = (b, a % b)
		(x, lastx) = (lastx - q * x, x)
		(y, lasty) = (lasty - q * y, y)
	return (lastx, lasty, a)

def inv(x):
	return egcd(x, P)[0]
Fact = [0 for i in range(N + 2)]
Finv = [0 for i in range(N + 2)]
Fact[0] = 1
Finv[0] = 1
for i in range(1, N + 2):
	Fact[i] = i * Fact[i - 1] % P
	Finv[i] = inv(Fact[i]) % P

def C(n, k):
	return Fact[n] * Finv[k] % P * Finv[n - k] % P
ans = [0 for i in range(N + 1)]
for i in range(1, N + 2):
	if i <= M:
		ans[i - 1] = (C(N + 1, i) - C(M - 1, i - 1)) % P
	else:
		ans[i - 1] = C(N + 1, i) % P
for i in ans:
	print(i)


from collections import Counter, deque, defaultdict

def inpl():
	return list(map(int, input().split()))
MOD = 10 ** 9 + 7

def cmb(n, r, mod):
	if r < 0 or r > n:
		return 0
	r = min(r, n - r)
	return g1[n] * g2[r] * g2[n - r] % mod
size = 2 * 10 ** 5 + 1
(g1, g2, inverse) = ([0] * size, [0] * size, [0] * size)
g1[:2] = [1, 1]
g2[:2] = [1, 1]
inverse[:2] = [0, 1]
for i in range(2, size):
	g1[i] = g1[i - 1] * i % MOD
	inverse[i] = -inverse[MOD % i] * (MOD // i) % MOD
	g2[i] = g2[i - 1] * inverse[i] % MOD
N = int(input())
A = inpl()
C = Counter(A)
for (k, v) in C.items():
	if v == 2:
		break
l = A.index(k)
r = N - A[::-1].index(k)
d = r - l - 1
print(N)
print((1 + N - 1 + d + cmb(N - 1, 2, MOD)) % MOD)
for k in range(3, N + 2):
	X = cmb(N - 1, k - 1, MOD)
	Y = cmb(N - 1 - d, k - 1, MOD)
	Z = X - Y
	tmp = cmb(N - 1, k, MOD) + Y + 2 * Z + cmb(N - 1, k - 2, MOD)
	print(tmp % MOD)


n = int(input())
A = [int(a) for a in input().split()]
pos = [-1] * n
for i in range(n + 1):
	if pos[A[i] - 1] >= 0:
		idx1 = pos[A[i] - 1]
		idx2 = i
		break
	pos[A[i] - 1] = i

def cmb(n, r, mod):
	if r < 0 or r > n:
		return 0
	r = min(r, n - r)
	return g1[n] * g2[r] * g2[n - r] % mod
mod = 10 ** 9 + 7
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]
for i in range(2, n + 2):
	g1.append(g1[-1] * i % mod)
	inverse.append(-inverse[mod % i] * (mod // i) % mod)
	g2.append(g2[-1] * inverse[-1] % mod)
ans = [0] * (n + 2)
for k in range(1, n + 2):
	ans[k] = cmb(n + 1, k, mod)
print(n)
for k in range(2, n + 2):
	c = cmb(idx1 + n - idx2, k - 1, mod)
	print((ans[k] - c) % mod)


n = int(input())
l = list(map(int, input().split()))
memo = {}
for i in range(n + 1):
	if l[i] in memo:
		g = l[i]
		(x, y) = (memo[g], i)
		break
	memo[l[i]] = i
mod = 10 ** 9 + 7
fact = [1] * (n + 1 + 1)
inv = [1] * (n + 1 + 1)
for i in range(2, n + 1 + 1):
	fact[i] = i * fact[i - 1] % mod
inv[-1] = pow(fact[-1], mod - 2, mod)
for i in range(n + 1, 1, -1):
	inv[i - 1] = inv[i] * i % mod

def comb(x, y):
	return fact[x] * inv[y] % mod * inv[x - y] % mod if x >= y >= 0 else 0
for i in range(1, n + 2):
	print((comb(n + 1, i) - comb(x + n - y, i - 1)) % mod)


import sys
input = sys.stdin.buffer.readline
import collections
import copy

def main():
	N = int(input())
	a = list(map(int, input().split()))
	c = collections.Counter(a)
	t = c.most_common()[0][0]
	pos = []
	for i in range(N + 1):
		if a[i] == t:
			pos.append(i)
	(l, r) = pos
	MOD = 10 ** 9 + 7
	fac = [0 for _ in range(N + 2)]
	(fac[0], fac[1]) = (1, 1)
	inv = copy.deepcopy(fac)
	invfac = copy.deepcopy(fac)
	for i in range(2, N + 2):
		fac[i] = fac[i - 1] * i % MOD
		inv[i] = MOD - MOD // i * inv[MOD % i] % MOD
		invfac[i] = invfac[i - 1] * inv[i] % MOD

	def coef(x, y):
		if x < y:
			return 0
		else:
			num = fac[x] * invfac[y] % MOD * invfac[x - y] % MOD
			return num
	for i in range(N + 1):
		i += 1
		al = coef(N + 1, i)
		dup = coef(N - r + l, i - 1)
		print((al - dup) % MOD)
main()


from collections import Counter
mod = 10 ** 9 + 7

class Combination:

	def __init__(self, N, MOD=10 ** 9 + 7):
		self.MOD = MOD
		(self.fact, self.inv) = self._make_factorial_list(N)

	def __call__(self, n, k):
		if k < 0 or k > n:
			return 0
		res = self.fact[n] * self.inv[k] % self.MOD
		res = res * self.inv[n - k] % self.MOD
		return res

	def _make_factorial_list(self, N):
		fact = [1] * (N + 1)
		inv = [1] * (N + 1)
		MOD = self.MOD
		for i in range(1, N + 1):
			fact[i] = fact[i - 1] * i % MOD
		inv[N] = pow(fact[N], MOD - 2, MOD)
		for i in range(N, 0, -1):
			inv[i - 1] = inv[i] * i % MOD
		return (fact, inv)

def __starting_point():
	N = int(input())
	A = list(map(int, input().split()))
	comb = Combination(N + 10)
	X = Counter(A).most_common()[0][0]
	l = A.index(X)
	r = A.index(X, l + 1)
	LR = l + (N - r)
	for i in range(1, N + 2):
		ans = comb(N + 1, i)
		ans -= comb(LR, i - 1)
		ans = (ans + mod) % mod
		print(ans)
__starting_point()


from collections import Counter
n = int(input())
a = list(map(int, input().split()))
kasanari = Counter(a).most_common()[0][0]
mod = 10 ** 9 + 7
basho = []
for (cnt, i) in enumerate(a):
	if i == kasanari:
		basho.append(cnt)

def cmb(n, r, mod):
	if r < 0 or n < r:
		return 0
	r = min(r, n - r)
	return fact[n] * factinv[r] * factinv[n - r] % mod
N = 2 * 10 ** 5
fact = [1, 1]
factinv = [1, 1]
inv = [0, 1]
for i in range(2, N + 1):
	fact.append(fact[-1] * i % mod)
	inv.append(-inv[mod % i] * (mod // i) % mod)
	factinv.append(factinv[-1] * inv[-1] % mod)
for i in range(1, n + 2):
	print((cmb(n + 1, i, mod) - cmb(n - basho[1] + basho[0], i - 1, mod)) % mod)


import collections
N = int(input())
a = list(map(int, input().split()))
c = collections.Counter(a)
dup = c.most_common()[0][0]
id = [i for (i, x) in enumerate(a) if x == dup]
L = id[0]
R = id[1]
MOD = 10 ** 9 + 7
factorial = [1]
inverse = [1]
for i in range(1, N + 2):
	factorial.append(factorial[i - 1] * i % MOD)
	inverse.append(pow(factorial[i], MOD - 2, MOD))

def C(n, r):
	if n < r:
		return 0
	return factorial[n] * inverse[r] * inverse[n - r] % MOD
print(N)
for i in range(2, N + 2):
	ans = (C(N + 1, i) - C(L + (N - R), i - 1)) % MOD
	print(ans)


C = 10 ** 9 + 7
n = int(input())
a = list(map(int, input().split()))
s = set()
result = [x for x in a if x in s or s.add(x)]
indices = [i for (i, x) in enumerate(a) if x == result[0]]
l = indices[0] + 1
r = indices[1] + 1
fact = [1]
for x in range(1, n + 2):
	fact.append(x * fact[x - 1] % C)
factinv = [1] * (n + 2)
factinv[n + 1] = pow(fact[n + 1], C - 2, C)
for x in range(n, -1, -1):
	factinv[x] = factinv[x + 1] * (x + 1) % C

def nCr(n, r):
	if n < 0 or r < 0 or n < r:
		return 0
	else:
		return fact[n] * factinv[r] * factinv[n - r] % C
for i in range(1, n + 2):
	print((nCr(n + 1, i) - nCr(n - (r - l), i - 1)) % C)


N = int(input())
A = [int(_) for _ in input().split()]
mod = 10 ** 9 + 7
f = [1] * (N + 2)
fi = [1] * (N + 2)
for i in range(2, N + 2):
	f[i] = i * f[i - 1]
	f[i] %= mod
for i in range(2, N + 2):
	fi[i] = fi[i - 1] * pow(i, mod - 2, mod)
	fi[i] %= mod

def comb(n, r):
	if 0 <= n and 0 <= r and (0 <= n - r):
		return f[n] * fi[r] * fi[n - r] % mod
	else:
		return 0
b = set()
for a in A:
	if a in b:
		break
	b.add(a)
c = []
for i in range(N + 1):
	if A[i] == a:
		c += [i]
(i, j) = c
for x in range(1, N + 2):
	print((comb(N + 1, x) - comb(N - j + i, x - 1)) % mod)


N = int(input())
A = list(map(int, input().split()))
mod = 10 ** 9 + 7
X_search_set = set()
for a in A:
	if a in X_search_set:
		X = a
		break
	else:
		X_search_set.add(a)
(x_left, x_right) = [i for (i, a) in enumerate(A) if a == X]
(Left, Right) = (x_left, N - x_right)
factorial = [1]
inverse = [1]
for i in range(1, N + 2):
	factorial.append(factorial[-1] * i % mod)
	inverse.append(pow(factorial[-1], mod - 2, mod))

def nCr(n, r):
	if n < r or r < 0:
		return 0
	elif r == 0:
		return 1
	return factorial[n] * inverse[r] * inverse[n - r] % mod
for k in range(1, len(A) + 1):
	ans = nCr(len(A), k)
	if k - 1 <= Left + Right:
		ans -= nCr(Left + Right, k - 1)
	print(ans % mod)


from collections import Counter
import sys
input = sys.stdin.readline
mod = 10 ** 9 + 7
n = int(input())
a = list(map(int, input().split()))
fact = [1] * (n + 2)
fact_inv = [1] * (n + 2)
for i in range(1, n + 2):
	fact[i] = i * fact[i - 1] % mod
	fact_inv[i] = pow(fact[i], mod - 2, mod)

def combination(n, k):
	if n < k:
		return 0
	return fact[n] * fact_inv[k] * fact_inv[n - k] % mod
x = Counter(a).most_common(1)[0][0]
front = a.index(x)
back = a[::-1].index(x)
for k in range(1, n + 2):
	ans = (combination(n + 1, k) - combination(front + back, k - 1)) % mod
	print(ans)


from statistics import mode
N = int(input())
A = list(map(int, input().split()))
MOD = 10 ** 9 + 7
C = mode(A)
C_indexes = [i for (i, x) in enumerate(A) if x == C]
outside = C_indexes[0] + len(A) - C_indexes[1] - 1
factorial = [1]
inverse = [1]
for i in range(1, N + 2):
	factorial.append(factorial[-1] * i % MOD)
	inverse.append(pow(factorial[i], MOD - 2, MOD))

def nCr(n, r):
	if n < r or n == 0 or r == 0:
		return 0
	return factorial[n] * inverse[r] * inverse[n - r] % MOD
print(N)
for i in range(2, N + 2):
	print(int(nCr(N + 1, i) - nCr(outside, i - 1)) % MOD)


from collections import Counter
n = int(input())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7
MAX = 10 ** 5 + 10
fact = [1] * (MAX + 1)
for i in range(1, MAX + 1):
	fact[i] = fact[i - 1] * i % mod
inv = [1] * (MAX + 1)
for i in range(2, MAX + 1):
	inv[i] = inv[mod % i] * (mod - mod // i) % mod
fact_inv = [1] * (MAX + 1)
for i in range(1, MAX + 1):
	fact_inv[i] = fact_inv[i - 1] * inv[i] % mod

def comb(n, r):
	if n < r:
		return 0
	return fact[n] * fact_inv[n - r] * fact_inv[r] % mod
c = Counter(a)
for (key, val) in c.items():
	if val == 2:
		break
idx = []
for (i, e) in enumerate(a):
	if e == key:
		idx.append(i)
l = idx[0]
r = n - idx[1]
for k in range(1, n + 2):
	ans = comb(n + 1, k) - comb(l + r, k - 1)
	ans %= mod
	print(ans)


def comb(n, r, mod):
	if r < 0 or r > n:
		return 0
	r = min(r, n - r)
	return g1[n] * g2[r] * g2[n - r] % mod
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]
n = int(input())
mod = 10 ** 9 + 7
for i in range(2, n + 1):
	g1.append(g1[-1] * i % mod)
	inverse.append(-inverse[mod % i] * (mod // i) % mod)
	g2.append(g2[-1] * inverse[-1] % mod)
import copy
a = list(map(int, input().split()))
b = copy.deepcopy(a)
b.sort()
tmp = -1
for i in range(n):
	if b[i] == b[i + 1]:
		tmp = b[i]
r = []
for i in range(n + 1):
	if a[i] == tmp:
		r.append(i)
y = abs(r[1] - r[0] - 1)
for k in range(1, n + 2):
	ans = (comb(n - 1, k, mod) + comb(n - 1, k - 2, mod) + comb(n - 1, k - 1, mod) * 2 - comb(n - 1 - y, k - 1, mod)) % mod
	print(ans)


N = int(input())
A = list(map(int, input().split()))
MOD = 10 ** 9 + 7
duplicate_x = None
checked = set()
for a in A:
	if a in checked:
		duplicate_x = a
	checked.add(a)
x_l_index = A.index(duplicate_x)
x_r_index = N + 1 - A[::-1].index(duplicate_x) - 1
factorial = [1, 1]
inverse = [1, 1]
invere_base = [0, 1]
for i in range(2, N + 2):
	factorial.append(factorial[-1] * i % MOD)
	invere_base.append(-invere_base[MOD % i] * (MOD // i) % MOD)
	inverse.append(inverse[-1] * invere_base[-1] % MOD)

def nCr(n, r):
	if not 0 <= r <= n:
		return 0
	return factorial[n] * inverse[r] * inverse[n - r] % MOD
for k in range(1, N + 1 + 1):
	print((nCr(N + 1, k) - nCr(max(0, x_l_index) + max(N + 1 - x_r_index - 1, 0), k - 1)) % MOD)


import sys
readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)

def main():
	n = int(readline())
	a = list(map(int, readline().split()))
	appeared = set()
	dup = 0
	for x in a:
		if x in appeared:
			dup = x
			break
		else:
			appeared.add(x)
	first = a.index(dup)
	second = a[first + 1:].index(dup) + first + 1
	print(n)
	p = first
	q = n + 1 - second - 1
	c1 = n + 1
	c2 = 1
	for i in range(2, n + 2):
		c1 *= n + 1 - (i - 1)
		c1 %= MOD
		c1 *= pow(i, MOD - 2, MOD)
		c1 %= MOD
		c2 *= p + q - (i - 2)
		c2 %= MOD
		c2 *= pow(i - 1, MOD - 2, MOD)
		c2 %= MOD
		print((c1 - c2) % MOD)
main()


import copy
import random
import bisect
import fractions
import math
mod = 10 ** 9 + 7
n = int(input())
a = [int(i) for i in input().split()]
factorial = [1]
inverse = [1]
for i in range(1, n + 2):
	factorial.append(factorial[-1] * i % mod)
	inverse.append(pow(factorial[-1], mod - 2, mod))

def combinations_count(n, r):
	if n - r < 0:
		return 0
	return factorial[n] * inverse[r] * inverse[n - r] % mod
A = copy.deepcopy(a)
A.sort()
for i in range(n + 1):
	if A[i] == A[i + 1]:
		double = A[i]
		break
cnt = 0
for i in range(n + 1):
	if a[i] == double:
		if cnt == 0:
			l = i + 1
			cnt += 1
		else:
			r = i + 1
for k in range(1, n + 2):
	ans = (combinations_count(n + 1, k) - combinations_count(l + n - r, k - 1)) % mod
	print(ans)


n = int(input())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7
N = 100000
inv_t = [0] + [1]
for i in range(2, N):
	inv_t += [inv_t[mod % i] * (mod - int(mod / i)) % mod]
kai = [1, 1]
rev_kai = [1, inv_t[1]]
for i in range(2, N):
	kai.append(kai[-1] * i % mod)
	rev_kai.append(rev_kai[-1] * inv_t[i] % mod)

def cmb(n, r):
	if n < r or n < 0 or r < 0:
		return 0
	else:
		return kai[n] * rev_kai[r] * rev_kai[n - r] % mod
d = {}
n1 = 0
n2 = 0
n3 = 0
for (i, ai) in enumerate(a):
	if ai not in d:
		d[ai] = i
	else:
		n1 = d[ai]
		n2 = i - d[ai] - 1
		n3 = n - i
		break
for i in range(1, n + 2):
	ans = 0
	ans += cmb(n - 1, i)
	ans += cmb(n - 1, i - 2)
	ans += cmb(n - 1 - n2, i - 1)
	if i >= 2 and i <= n:
		ans += 2 * (cmb(n2 + n1 + n3, i - 1) - cmb(n1 + n3, i - 1))
	print(ans % mod)


class Factorial:

	def __init__(self, n, mod):
		self.mod = mod
		self.factorial = [0 for _ in range(n + 1)]
		self.inv = [0 for _ in range(n + 1)]
		self.factorial[0] = 1
		for i in range(n):
			self.factorial[i + 1] = self.factorial[i] * (i + 1) % mod
		self.inv[n] = pow(self.factorial[n], mod - 2, mod)
		for i in range(n)[::-1]:
			self.inv[i] = self.inv[i + 1] * (i + 1) % mod

	def comb(self, m, k):
		if m - k < 0 or k < 0:
			return 0
		return self.factorial[m] * self.inv[k] * self.inv[m - k] % self.mod
MOD = 1000000007
N = int(input())
A = list(map(int, input().split()))
F = Factorial(N + 1, MOD)
tmp = [None for _ in range(N)]
for i in range(N + 1):
	if tmp[A[i] - 1] is None:
		tmp[A[i] - 1] = i
	else:
		a = tmp[A[i] - 1]
		b = i
		break
A = []
for i in range(1, N + 2):
	A.append((F.comb(N - 1, i) + F.comb(N - 1, i - 2) + F.comb(N - 1, i - 1) * 2 - F.comb(N + a - b, i - 1)) % MOD)
print('\n'.join(map(str, A)))


from collections import Counter
N = int(input())
A = list(map(int, input().split()))
mod = 10 ** 9 + 7
fact = [1]
for i in range(1, N + 2):
	fact.append(fact[-1] * i % mod)
ans = [0] * (N + 2)
fN = fact[N + 1]
for i in range(1, N + 2):
	div = fact[i] * fact[N - i + 1] % mod
	value = fN * pow(div, mod - 2, mod) % mod
	ans[i] = value
x = Counter(A).most_common()[0][0]
left = A.index(x)
right = N - A.index(x, left + 1)
M = left + right
for i in range(0, M + 1):
	num = fact[M]
	div = fact[i] * fact[M - i] % mod
	comb = num * pow(div, mod - 2, mod) % mod
	ans[i + 1] = (ans[i + 1] - comb + mod) % mod
print(*ans[1:], sep='\n')


n = int(input()) + 1
a = [int(item) for item in input().split()]
MOD = 10 ** 9 + 7

def mod_pow(x, n):
	ans = 1
	while n != 0:
		if n & 1:
			ans = ans * x % MOD
		x = x * x % MOD
		n = n >> 1
	return ans
fac = [1] + [0] * n
inv_fac = [1] + [0] * n
for i in range(1, n + 1):
	fac[i] = fac[i - 1] * i % MOD
	inv_fac[i] = inv_fac[i - 1] * mod_pow(i, MOD - 2) % MOD

def mod_nCr(n, r):
	if n == 0 and r == 0:
		return 1
	if n < r or n < 0:
		return 0
	tmp = inv_fac[n - r] * inv_fac[r] % MOD
	return tmp * fac[n] % MOD
index = [-1] * (n + 1)
(l, r) = (0, 0)
for (i, c) in enumerate(a):
	if index[c] == -1:
		index[c] = i
	else:
		l = index[c]
		r = i
for i in range(1, n + 1):
	total = mod_nCr(n, i)
	doubled = mod_nCr(n - (r - l) - 1, i - 1)
	ans = total - doubled
	if ans < 0:
		ans += MOD
	print(ans)


N = int(input())
A = list(map(int, input().split()))
from collections import defaultdict
d = {}
for (i, a) in enumerate(A):
	if a not in d:
		d[a] = i
	else:
		l = d[a]
		r = i
		break
mod = 10 ** 9 + 7
n = 100010
frac = [1] * (n + 1)
finv = [1] * (n + 1)
for i in range(n):
	frac[i + 1] = (i + 1) * frac[i] % mod
finv[-1] = pow(frac[-1], mod - 2, mod)
for i in range(1, n + 1):
	finv[n - i] = finv[n - i + 1] * (n - i + 1) % mod

def nCr(n, r):
	if n < 0 or r < 0 or n < r:
		return 0
	r = min(r, n - r)
	return frac[n] * finv[n - r] * finv[r] % mod
ans = 0
for i in range(1, N + 2):
	ans = nCr(N + 1, i) - nCr(N + l - r, i - 1)
	ans %= mod
	print(ans)


from math import factorial
n = int(input())
a = list(map(int, input().split()))
se = set()
mod = 10 ** 9 + 7
for (i, j) in enumerate(a):
	if j in se:
		two = i
	else:
		se.add(j)
one = a.index(a[two])

def prepare(n, MOD):
	facts = [1] * (n + 1)
	for i in range(1, n + 1):
		facts[i] = facts[i - 1] * i % MOD
	invs = [1] * (n + 1)
	invs[n] = pow(facts[n], MOD - 2, MOD)
	for i in range(0, n)[::-1]:
		invs[i] = invs[i + 1] * (i + 1) % MOD
	return (facts, invs)
(facts, invs) = prepare(n + 1, mod)

def make_combi(facts, invs, n, r, mod):
	return facts[n] * invs[r] * invs[n - r] % mod
for i in range(1, n + 2):
	point = make_combi(facts, invs, n + 1, i, mod)
	if one + n - two >= i - 1:
		point -= make_combi(facts, invs, one + n - two, i - 1, mod)
	print(point % mod)


import sys

def main():
	input = sys.stdin.readline
	N = int(input())
	A = list(map(int, input().split()))
	MOD = 10 ** 9 + 7
	used = set()
	first = 0
	second = 0
	for i in range(N + 1):
		if A[i] in used:
			second = i
			first = A.index(A[i])
		else:
			used.add(A[i])
	factrial = [1] * (N + 2)
	for k in range(1, N + 2):
		factrial[k] = factrial[k - 1] * k % MOD
	fact_inv = [1] * (N + 2)
	fact_inv[N + 1] = pow(factrial[N + 1], MOD - 2, MOD)
	for k in range(N, -1, -1):
		fact_inv[k] = fact_inv[k + 1] * (k + 1) % MOD

	def comb(n, r, MOD):
		if n < 0 or r < 0 or n < r:
			return 0
		else:
			return factrial[n] * fact_inv[r] * fact_inv[n - r] % MOD
	m = first + (N - second)
	for i in range(1, N + 2):
		ans = comb(N + 1, i, MOD) - comb(m, i - 1, MOD)
		print(int(ans) % MOD)
main()


from collections import Counter
N = int(input())
A = tuple(map(int, input().split()))
mod = 10 ** 9 + 7
U = N + 10
fact = [1] * (U + 1)
inv = [1] * (U + 1)
for i in range(1, U + 1):
	fact[i] = fact[i - 1] * i % mod
inv[U] = pow(fact[i], mod - 2, mod)
for i in range(U, 0, -1):
	inv[i - 1] = inv[i] * i % mod

def comb(N, r):
	if r < 0 or r > N:
		return 0
	res = fact[N] * inv[r] % mod
	res = res * inv[N - r] % mod
	return res
X = Counter(A).most_common()[0][0]
left = A.index(X)
right = A[::-1].index(X)
LR = left + right
for i in range(1, N + 2):
	ans = comb(N + 1, i) - comb(LR, i - 1)
	ans = (ans + mod) % mod
	print(ans)


from collections import Counter
n = int(input())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7
factorial = [1 for i in range(n + 2)]
for i in range(1, n + 2):
	if i == 1:
		factorial[i] = 1
	else:
		factorial[i] = factorial[i - 1] * i % mod

def comb(n, k):
	return factorial[n] * pow(factorial[n - k] * factorial[k], -1, mod)
mc = Counter(a).most_common()[0][0]
indices = []
for i in range(n + 1):
	if a[i] == mc:
		indices.append(i)
m = [indices[0] + 1, n + 1 - indices[1]]
m = sorted(m)
for i in range(1, n + 2):
	if i == 1:
		print(n)
		continue
	if i == n + 1:
		print(1)
		continue
	if i <= m[0] + m[1] - 1:
		print((comb(n + 1, i) - comb(m[0] + m[1] - 2, i - 1)) % mod)
	else:
		print(comb(n + 1, i) % mod)


n = int(input())
al = list(map(int, input().split()))
import collections
c = collections.Counter(al)
cc = c.most_common()[0][0]
da = [i for (i, x) in enumerate(al) if x == cc][0]
db = [i for (i, x) in enumerate(al) if x == cc][1]

def cmb(n, r, p):
	if r < 0 or n < r:
		return 0
	r = min(r, n - r)
	return fact[n] * factinv[r] * factinv[n - r] % p
p = 10 ** 9 + 7
fact = [1, 1]
factinv = [1, 1]
inv = [0, 1]
for i in range(2, n + 2):
	fact.append(fact[-1] * i % p)
	inv.append(-inv[p % i] * (p // i) % p)
	factinv.append(factinv[-1] * inv[-1] % p)
print(n)
for i in range(2, n + 2):
	print((cmb(n - 1, i, p) + cmb(n - 1, i - 1, p) * 2 - cmb(da + n - db, i - 1, p) + cmb(n - 1, i - 2, p)) % p)


from collections import Counter
N = int(input())
As = list(map(int, input().split()))
MOD = 10 ** 9 + 7
factorials = [1]
fact_invs = [1]
for i in range(1, N + 2):
	factorials.append(factorials[-1] * i % MOD)
	fact_invs.append(pow(factorials[-1], MOD - 2, MOD))
fact_invs.append(1)

def combi(n, k):
	if n < k:
		return 0
	ret = factorials[n]
	ret *= fact_invs[k]
	ret %= MOD
	ret *= fact_invs[n - k]
	return ret % MOD
ct = Counter(As)
mc = ct.most_common(1)[0][0]
L = R = None
for (i, a) in enumerate(As):
	if a == mc:
		if L is None:
			L = i
		else:
			R = N - i
for k in range(1, N + 2):
	print((combi(N + 1, k) - combi(L + R, k - 1)) % MOD)


INF = 10 ** 9 + 7
n = int(input())
a = list(map(int, input().split()))
s = set()
result = [x for x in a if x in s or s.add(x)]
indexes = [i for (i, x) in enumerate(a) if x == result[0]]
l0 = indexes[0] + 1
l1 = indexes[1] + 1

def bin_pow(a, n):
	ans = 1
	mag = a
	while n > 0:
		if n % 2 == 0:
			mag = mag * mag % INF
			n /= 2
		else:
			ans = ans * mag % INF
			n -= 1
	return ans
factorial = [0] * (n + 2)
inverse_factorial = [0] * (n + 2)
factorial[0] = 1
for i in range(1, n + 2):
	factorial[i] = factorial[i - 1] * i % INF
inverse_factorial[n + 1] = bin_pow(factorial[n + 1], INF - 2)
for i in range(n, -1, -1):
	inverse_factorial[i] = inverse_factorial[i + 1] * (i + 1) % INF

def combi(n, r):
	if n < 0 or r < 0 or n < r:
		return 0
	return factorial[n] * inverse_factorial[r] % INF * (inverse_factorial[n - r] % INF)
for i in range(1, n + 2):
	print((combi(n + 1, i) - combi(n - (l1 - l0), i - 1)) % INF)


from collections import Counter
N = int(input())
src = list(map(int, input().split()))
ctr = Counter(src)
most = ctr.most_common(1)[0][0]
i1 = src.index(most)
i2 = src[i1 + 1:].index(most) + i1 + 1
d = i2 - i1
MOD = 10 ** 9 + 7

def mul(a, b):
	return a * b % MOD

def pow(a, n):
	ret = 1
	mag = a
	while n > 0:
		if n & 1:
			ret = mul(ret, mag)
		mag = mul(mag, mag)
		n >>= 1
	return ret

def inv(a):
	return pow(a, MOD - 2)
fac = [1]
fac_inv = [1]
for n in range(1, N + 3):
	f = mul(fac[n - 1], n)
	fac.append(f)
	fac_inv.append(inv(f))

def ncr(n, r):
	return mul(mul(fac[n], fac_inv[n - r]), fac_inv[r])
anss = []
for r in range(1, N + 2):
	anss.append(ncr(N + 1, r))
n = N - d
for r in range(n + 1):
	anss[r] -= ncr(n, r)
	anss[r] %= MOD
print(*anss, sep='\n')


from collections import Counter
(n, *a) = map(int, open(0).read().split())
dbl = Counter(a).most_common()[0][0]
(l, r) = [i for (i, j) in enumerate(a) if j == dbl]
const = n + l - r
m = n + 1
mod = 10 ** 9 + 7
fac = [1] * (m + 1)
inv = [1] * (m + 1)
for i in range(1, m + 1):
	fac[i] = fac[i - 1] * i % mod
inv[-1] = pow(fac[-1], mod - 2, mod)
for i in range(m - 1, -1, -1):
	inv[i] = inv[i + 1] * (i + 1) % mod

def cmb(n, r):
	if n < r:
		return 0
	return fac[n] * inv[n - r] * inv[r] % mod
for k in range(1, n + 2):
	print((cmb(n + 1, k) - cmb(const, k - 1)) % mod)


n = int(input())
a = list(map(int, input().split()))
b = sorted(a[:])
for i in range(n):
	if b[i] == b[i + 1]:
		d = b[i]
(l, r) = (-1, -1)
for i in range(n + 1):
	if l < 0:
		if a[i] == d:
			l = i
	elif a[i] == d:
		r = i
f = [1 for _ in range(n + 2)]
f_inv = [1 for _ in range(n + 2)]
mod = 10 ** 9 + 7
for i in range(1, n + 2):
	f[i] = f[i - 1] * i % mod
	f_inv[i] = pow(f[i], mod - 2, mod)

def comb(n, k):
	return f[n] * f_inv[k] * f_inv[n - k] % mod
for k in range(1, n + 2):
	ans = 0
	if k >= 2:
		ans += comb(n - 1, k - 2)
		ans %= mod
	if n - 1 >= k:
		ans += comb(n - 1, k)
		ans %= mod
	if n >= k:
		ans += 2 * comb(n - 1, k - 1)
		ans %= mod
	if n + l - r >= k - 1:
		ans -= comb(n + l - r, k - 1)
		ans %= mod
	print(ans)


n = int(input())
l = list(map(int, input().split()))
l1 = [[l[i], i] for i in range(n + 1)]
l1.sort()
for i in range(n):
	if l1[i][0] == l1[i + 1][0]:
		(a, b) = (l1[i][1], l1[i + 1][1])
m = b - a + 1
k = n - m + 1
mod = 10 ** 9 + 7
fact = [1, 1]
finv = [1, 1]
inv = [0, 1]
for i in range(2, n + 5):
	fact.append(fact[-1] * i % mod)
	inv.append(inv[mod % i] * (mod - mod // i) % mod)
	finv.append(finv[-1] * inv[-1] % mod)

def nCr(n, r, mod):
	if r > n:
		return 0
	else:
		return fact[n] * finv[r] * finv[n - r] % mod
for i in range(1, n + 2):
	a = nCr(n + 1, i, mod) - nCr(k, i - 1, mod)
	print(a % mod)


n = int(input())
a = list(map(int, input().split()))

class ModInv:

	def __init__(self, size, MOD):
		self.inv = [0] * (size + 1)
		self.inv[1] = 1
		for i in range(2, size + 1):
			self.inv[i] = -(MOD // i) * self.inv[MOD % i] % MOD
if n == 1:
	print(1)
	print(1)
	exit()
MOD = 10 ** 9 + 7
b = sorted(a)
for i in range(n):
	if b[i] == b[i + 1]:
		break
first = a.index(b[i])
for i in range(first + 1, n + 1):
	if a[i] == a[first]:
		second = i
w = n + first - second
inv = ModInv(n + 1, MOD)
c = [1] * (n + 2)
d = [1] * (n + 2)
for i in range(n + 1):
	d[i + 1] = d[i] * inv.inv[i + 1] % MOD
for i in range(n + 1):
	c[i + 1] = c[i] * (i + 1) % MOD
print(n)
for k in range(2, n + 2):
	ans = c[n + 1] * d[n + 1 - k] % MOD * d[k] % MOD
	if w >= k - 1:
		ans -= c[w] * d[w - k + 1] % MOD * d[k - 1] % MOD
	print(ans % MOD)


n = int(input())
A = [int(x) for x in input().split()]
p = 10 ** 9 + 7
found = {}
for (i, a) in enumerate(A):
	if a in found:
		dup = a
		dup_1 = found[a]
		dup_2 = i
	found[a] = i
from functools import lru_cache

@lru_cache(maxsize=None)
def gfp_inv(x, p):
	return pow(x, p - 2, p)
from itertools import chain, accumulate
memo_fact = list(chain([1], accumulate(range(1, 10 ** 5 + 2), lambda a, x: a * x % p)))

def comb(n, m):
	if m < 0 or n < m:
		return 0
	if n == m:
		return 1
	return memo_fact[n] * gfp_inv(memo_fact[n - m], p) * gfp_inv(memo_fact[m], p) % p
intv = dup_2 - dup_1 - 1
for k in range(1, n + 2):
	ans = comb(n + 1, k)
	ans -= comb(n + 1 - intv - 2, k - 1)
	print(ans % p)


mod = 10 ** 9 + 7
n = int(input())
A = list(map(int, input().split()))
B = sorted(A)
for i in range(1, n + 1):
	if B[i] == B[i - 1]:
		x = B[i]
r = A[::-1].index(x)
l = A.index(x)
s = n + 1
INV = [None] * (s + 1)
for i in range(1, s + 1):
	INV[i] = pow(i, mod - 2, mod)
Combi = [None] * (s + 1)
Combi[0] = 1
for i in range(1, s + 1):
	Combi[i] = Combi[i - 1] * (s - i + 1) * INV[i] % mod
m = r + l
INV2 = [None] * (m + 1)
for i in range(1, m + 1):
	INV2[i] = pow(i, mod - 2, mod)
Combi2 = [None] * (m + 1)
Combi2[0] = 1
for i in range(1, m + 1):
	Combi2[i] = Combi2[i - 1] * (m - i + 1) * INV2[i] % mod
print(n)
for i in range(2, n + 2):
	ANS = Combi[i]
	if m >= i - 1:
		ANS -= Combi2[i - 1]
	print(ANS % mod)


MOD = 10 ** 9 + 7
from collections import Counter

def facinv(N):
	(fac, finv, inv) = ([0] * (N + 1), [0] * (N + 1), [0] * (N + 1))
	fac[0] = 1
	fac[1] = 1
	finv[0] = 1
	finv[1] = 1
	inv[1] = 1
	for i in range(2, N + 1):
		fac[i] = fac[i - 1] * i % MOD
		inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD
		finv[i] = finv[i - 1] * inv[i] % MOD
	return (fac, finv, inv)

def COM(n, r):
	if n < r or r < 0:
		return 0
	else:
		return fac[n] * finv[r] % MOD * finv[n - r] % MOD
N = int(input())
(fac, finv, inv) = facinv(N + 1)
A = list(map(int, input().split()))
m = Counter(A).most_common()[0][0]
(L, R) = sorted([i for i in range(N + 1) if A[i] == m])
R = N - R
for k in range(1, N + 2):
	print((COM(N + 1, k) - COM(L + R, k - 1) + MOD) % MOD)


import sys
mod = 7 + 10 ** 9

def comb(n, r, fact, revfact, mod):
	return fact[n] * revfact[n - r] * revfact[r] % mod

def solve():
	input = sys.stdin.readline
	N = int(input())
	A = [int(a) for a in input().split()]
	Ad = dict()
	double = []
	for (i, a) in enumerate(A):
		if a in Ad:
			Ad[a].append(i)
			double = Ad[a]
		else:
			Ad[a] = [i]
	fact = [1] * (N + 2)
	for i in range(1, N + 2):
		fact[i] = fact[i - 1] * i % mod
	revfact = [1] * (N + 2)
	revfact[N + 1] = pow(fact[N + 1], mod - 2, mod)
	for i in reversed(range(1, N + 1)):
		revfact[i] = (i + 1) * revfact[i + 1] % mod
	mayOverCount = double[0] + N - double[1]
	for k in range(N + 1):
		total = comb(N + 1, k + 1, fact, revfact, mod)
		if k <= mayOverCount:
			total += mod - comb(mayOverCount, k, fact, revfact, mod)
			total %= mod
		print(total)
	return 0
solve()


def build_combination(n, mod):

	def cmb(n, r):
		if r < 0 or n < r:
			return 0
		return invs[r] * invs[n - r] % mod * fact[n] % mod
	fact = [1] * (n + 1)
	for x in range(2, n + 1):
		fact[x] = x * fact[x - 1] % mod
	invs = [1] * (n + 1)
	invs[n] = pow(fact[n], mod - 2, mod)
	for x in range(n - 1, 0, -1):
		invs[x] = invs[x + 1] * (x + 1) % mod
	return cmb

def find(a):
	n = len(a)
	checked = [-1] * (n + 1)
	for (i, x) in enumerate(a):
		if checked[x] != -1:
			return (checked[x], i)
		else:
			checked[x] = i
	raise ValueError

def main():
	mod = 10 ** 9 + 7
	n = int(input())
	(*a,) = list(map(int, input().split()))
	cmb = build_combination(n + 1, mod)
	(li, ri) = find(a)
	for k in range(1, n + 2):
		ret = (cmb(n + 1, k) - cmb(n + 1 - (ri - li + 1), k - 1)) % mod
		print(ret)

def __starting_point():
	main()
__starting_point()


class COM:

	def __init__(self, n: int, mod: int):
		self.n = n
		self.mod = mod
		self.fact = [0] * (n + 1)
		self.factinv = [0] * (n + 1)
		self.inv = [0] * (n + 1)
		self.fact[0] = self.fact[1] = 1
		self.factinv[0] = self.factinv[1] = 1
		self.inv[1] = 1
		for i in range(2, n + 1):
			self.fact[i] = self.fact[i - 1] * i % mod
			self.inv[i] = -self.inv[mod % i] * (mod // i) % mod
			self.factinv[i] = self.factinv[i - 1] * self.inv[i] % mod

	def get_cmb(self, n: int, k: int):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		return self.fact[n] * self.factinv[k] % self.mod * self.factinv[n - k] % self.mod

def solve():
	n = int(input())
	a = list(map(int, input().split()))
	MOD = 10 ** 9 + 7
	pos = dict()
	(l, r) = (-1, -1)
	for i in range(n + 1):
		if a[i] in pos:
			(l, r) = (pos[a[i]], i)
			break
		pos[a[i]] = i
	com = COM(10 ** 5 + 1, MOD)
	print(n)
	for i in range(2, n + 1):
		ans = com.get_cmb(n + 1, i) - com.get_cmb(l + n - r, i - 1)
		print(ans % MOD)
	print(1)

def __starting_point():
	solve()
__starting_point()


class Combination:

	def __init__(self, n, mod):
		fact = [0] * (n + 1)
		ifact = [0] * (n + 1)
		fact[0] = 1
		for i in range(1, n + 1):
			fact[i] = fact[i - 1] * i % mod
		ifact[n] = pow(fact[n], mod - 2, mod)
		for i in range(n, 0, -1):
			ifact[i - 1] = ifact[i] * i % mod
		self.n = n
		self.mod = mod
		self.fact = fact
		self.ifact = ifact

	def choose(self, n, r):
		if r < 0 or r > n:
			return 0
		ret = self.fact[n] * self.ifact[r] % self.mod
		return ret * self.ifact[n - r] % self.mod
n = int(input())
(*a,) = map(int, input().split())
indices = [-1] * n
(l, r) = (0, 0)
for i in range(n + 1):
	if indices[a[i] - 1] != -1:
		l = indices[a[i] - 1]
		r = i
		break
	indices[a[i] - 1] = i
MOD = 10 ** 9 + 7
c = Combination(n + 2, MOD)
for i in range(1, n + 2):
	ans = c.choose(n + 1, i) - c.choose(l + n - r, i - 1)
	ans = (ans + MOD) % MOD
	print(ans)


g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]
MOD = 10 ** 9 + 7
for i in range(2, 10 ** 5 + 10):
	g1.append(g1[-1] * i % MOD)
	inverse.append(-inverse[MOD % i] * (MOD // i) % MOD)
	g2.append(g2[-1] * inverse[-1] % MOD)

def comb(n, r, mod=MOD):
	if r < 0 or r > n:
		return 0
	r = min(r, n - r)
	return g1[n] * g2[r] * g2[n - r] % mod
N = int(input())
A = map(int, input().split())
d = {}
n1 = n2 = -1
for (i, a) in enumerate(A):
	if a in d:
		n1 = N - i
		n2 = d[a]
		break
	d[a] = i
ans = [0] * (N + 1)
for k in range(1, N + 2):
	ans[k - 1] = (comb(N + 1, k) - comb(n1 + n2, k - 1)) % MOD
print(*ans, sep='\n')


N = int(input())
e = list(map(int, input().split()))
mod = 1000000007
kai = [0] * (N + 3)
from collections import Counter
c = Counter(e).most_common(1)[0][0]
g = e.index(c)
e.remove(c)
f = e.index(c) + 1
e = []
for i in range(N + 3):
	if i == 0:
		kai[i] = 1
	else:
		kai[i] = kai[i - 1] * i % mod

def comb(n, k, p):
	if n < 0 or k < 0 or n < k:
		return 0
	if n == 0 or k == 0:
		return 1
	a = kai[n]
	b = kai[k]
	c = kai[n - k]
	b = pow(b, mod - 2, mod)
	c = pow(c, mod - 2, mod)
	return a * b * c % mod
h = [1] * ((N + 6) // 2)
for j in range((N + 4) // 2):
	h[j + 1] = comb(N + 1, j + 1, mod)
for j in range(N + 1):
	if N - j > N / 2:
		print((h[j + 1] - comb(g + N - f, j, mod) + mod) % mod)
	else:
		print((h[N - j] - comb(g + N - f, j, mod) + mod) % mod)


(n, *a) = map(int, open(0).read().split())
b = {}
M = 10 ** 9 + 7
p = n + 1
q = r = 1
for (i, x) in enumerate(a):
	if x in b:
		d = i - b[x]
		break
	b[x] = i
for k in range(n + 1):
	print((p - q) % M)
	q = q * (n - d - k) * r % M
	r = pow(k + 2, M - 2, M)
	p = p * (n - k) * r % M


from collections import Counter
N = int(input())
src = list(map(int, input().split()))
ctr = Counter(src)
doub = ctr.most_common()[0][0]
i1 = src.index(doub)
i2 = src[::-1].index(doub)
doub_len = i1 + i2 + 1
MOD = 10 ** 9 + 7
fac = [1, 1] + [0] * N
finv = [1, 1] + [0] * N
inv = [0, 1] + [0] * N
for i in range(2, N + 2):
	fac[i] = fac[i - 1] * i % MOD
	inv[i] = -inv[MOD % i] * (MOD // i) % MOD
	finv[i] = finv[i - 1] * inv[i] % MOD

def ncr(n, r):
	if n < r:
		return 0
	if n < 0 or r < 0:
		return 0
	return fac[n] * (finv[r] * finv[n - r] % MOD) % MOD
ans = []
for i in range(1, N + 2):
	ans.append(ncr(N + 1, i))
for i in range(doub_len):
	ans[i] -= ncr(doub_len - 1, i)
	ans[i] %= MOD
print(*ans, sep='\n')


from collections import defaultdict
MOD = 1000000007
n = int(input())
alst = list(map(int, input().split()))
dic = defaultdict(list)
for i in range(n + 1):
	dic[alst[i]].append(i)
for v in dic.values():
	if len(v) == 2:
		(left, right) = v
		break
rem = n + 1 - (right - left + 1)
factMem = {}

def fact(x):
	if x <= 0:
		return 1
	if x in factMem:
		return factMem[x]
	factMem[x] = x * fact(x - 1) % MOD
	return factMem[x]
for x in range(n + 1):
	fact(x)
inverseMem = {}

def inverse(x):
	if x in inverseMem:
		return inverseMem[x]
	inverseMem[x] = pow(x, MOD - 2, MOD)
	return inverseMem[x]

def comb(x, y):
	if x < y or y < 0:
		return 0
	return fact(x) * inverse(fact(y)) * inverse(fact(x - y)) % MOD
for i in range(n + 1):
	print((comb(n + 1, i + 1) - comb(rem, i)) % MOD)


from collections import Counter
n = int(input())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7

class nCr:

	def __init__(self, n):
		self.n = n
		self.fa = [1] * (self.n + 1)
		self.fi = [1] * (self.n + 1)
		for i in range(1, self.n + 1):
			self.fa[i] = self.fa[i - 1] * i % mod
			self.fi[i] = pow(self.fa[i], mod - 2, mod)

	def comb(self, n, r):
		if n < r:
			return 0
		if n < 0 or r < 0:
			return 0
		return self.fa[n] * self.fi[r] % mod * self.fi[n - r] % mod
comb = nCr(2 * n)
c = Counter(a)
num = c.most_common()[0][0]
(l, r) = (a.index(num), n - list(reversed(a)).index(num))
for i in range(1, n + 2):
	print((comb.comb(n + 1, i) - comb.comb(n - (r - l), i - 1)) % mod)


mod = 10 ** 9 + 7
n = int(input())
a = list(map(int, input().split()))
place = [-1] * n
for i in range(n + 1):
	if place[a[i] - 1] == -1:
		place[a[i] - 1] = i
	else:
		R = (place[a[i] - 1], i)
		break

def c(a, b):
	if a == b == 0:
		return 1
	if a < b or a <= 0 or b < 0:
		return 0
	r = fac[a - b] * fac[b] % mod
	return fac[a] * pow(r, mod - 2, mod) % mod
fac = [1]
for i in range(n + 1):
	fac.append(fac[-1] * (i + 1) % mod)
for i in range(1, n + 2):
	ans = (c(n + 1, i) - c(R[0] + n - R[1], i - 1)) % mod
	print(ans)


import sys
from collections import defaultdict
from math import factorial
input = sys.stdin.buffer.readline
mod = 10 ** 9 + 7
nmax = 10 ** 5 + 2
fac = [0] * (nmax + 1)
finv = [0] * (nmax + 1)
inv = [0] * (nmax + 1)
fac[0] = 1
fac[1] = 1
finv[0] = 1
finv[1] = 1
inv[1] = 1
for i in range(2, nmax):
	fac[i] = fac[i - 1] * i % mod
	inv[i] = mod - inv[mod % i] * (mod // i) % mod
	finv[i] = finv[i - 1] * inv[i] % mod

def comb(n, r):
	if n < r:
		return 0
	else:
		return fac[n] * (finv[r] * finv[n - r] % mod) % mod
N = int(input())
a = list(map(int, input().split()))
pos = defaultdict(lambda : -1)
for i in range(N + 1):
	if pos[a[i]] == -1:
		pos[a[i]] = i
	else:
		same = (pos[a[i]], i)
		break
for k in range(1, N + 2):
	print((comb(N + 1, k) - comb(same[0] + (N - same[1]), k - 1)) % mod)


MOD = 10 ** 9 + 7
n = int(input())
a = list(map(int, input().split()))
lst = [-1] * n
for i in range(n + 1):
	if lst[a[i] - 1] != -1:
		first = lst[a[i] - 1]
		second = i
		break
	lst[a[i] - 1] = i
left = first
right = n - second
U = 10 ** 5 + 1

def power_mod(a, n):
	if n == 0:
		return 1
	x = power_mod(a // 2)

def make_fact(fact, fact_inv):
	for i in range(1, U + 1):
		fact[i] = fact[i - 1] * i % MOD
	fact_inv[U] = pow(fact[U], MOD - 2, MOD)
	for i in range(U, 0, -1):
		fact_inv[i - 1] = fact_inv[i] * i % MOD

def comb(n, k):
	if k < 0 or n < k:
		return 0
	x = fact[n]
	x *= fact_inv[k]
	x %= MOD
	x *= fact_inv[n - k]
	x %= MOD
	return x
fact = [1] * (U + 1)
fact_inv = [1] * (U + 1)
make_fact(fact, fact_inv)
for i in range(1, n + 2):
	ans = comb(n + 1, i) - comb(left + right, i - 1)
	print(ans % MOD)


def cmb(n, r, mod):
	if r < 0 or r > n:
		return 0
	r = min(r, n - r)
	return g1[n] * g2[r] * g2[n - r] % mod
mod = 10 ** 9 + 7
N = 10 ** 6
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]
for i in range(2, N + 1):
	g1.append(g1[-1] * i % mod)
	inverse.append(-inverse[mod % i] * (mod // i) % mod)
	g2.append(g2[-1] * inverse[-1] % mod)
N = int(input())
A = [int(c) for c in input().split()]
log = [0] * (N + 1)
for i in range(N + 1):
	if log[A[i]] != 0:
		j = i
	log[A[i]] = 1
c = A[j]
i = A.index(c)
m = i + N - j
for k in range(1, N + 2):
	if m >= k - 1:
		x = cmb(N + 1, k, mod) - cmb(m, k - 1, mod)
		print(x % mod)
	else:
		x = cmb(N + 1, k, mod)
		print(x % mod)


n = int(input())
A = list(map(int, input().split()))
mod = 10 ** 9 + 7

class combinationmod:

	def __init__(self, MAX, mod):
		self.mod = mod
		self.fac = [0] * (MAX + 1)
		self.finv = [0] * (MAX + 1)
		self.inv = [0] * (MAX + 1)
		self.fac[0] = self.fac[1] = 1
		self.finv[0] = self.finv[1] = 1
		self.inv[1] = 1
		for i in range(2, MAX + 1):
			self.fac[i] = self.fac[i - 1] * i % self.mod
			self.inv[i] = -self.inv[mod % i] * (mod // i) % self.mod
			self.finv[i] = self.finv[i - 1] * self.inv[i] % self.mod

	def nCk(self, n, k):
		if n < k or n < 0 or k < 0:
			return 0
		return self.fac[n] * (self.finv[k] * self.finv[n - k] % self.mod) % self.mod
memo = {}
for (i, a) in enumerate(A):
	if a in memo:
		L = memo[a]
		R = len(A) - i - 1
		break
	else:
		memo[a] = i
c = combinationmod(n + 1, mod)
for k in range(1, n + 2):
	print((c.nCk(n + 1, k) - c.nCk(L + R, k - 1)) % mod)


import sys
input = sys.stdin.readline
n = int(input())
mod = pow(10, 9) + 7
ct = [1] * (n + 1)
for i in range(1, n + 1):
	ct[i] = ct[i - 1] * i % mod

def comb(n, k):
	res = ct[n] * pow(ct[n - k], mod - 2, mod) % mod * pow(ct[k], mod - 2, mod) % mod
	return res

def main():
	a = [int(x) for x in input().split()]
	already = [-1] * n
	for i in range(n + 1):
		if already[a[i] - 1] != -1:
			(f, s) = (already[a[i] - 1], n - i)
			break
		already[a[i] - 1] = i
	ans = [0] * (n + 1)
	c = 1
	for i in range(n + 1):
		c = c * (n + 1 - i) % mod * pow(i + 1, mod - 2, mod) % mod
		ans[i] += c % mod
	for i in range(n):
		if s + f >= i:
			ans[i] += mod - comb(f + s, i) % mod
		ans[i] %= mod
	for a in ans:
		print(a)
main()


n = int(input())
A = list(map(int, input().split()))
mod = 10 ** 9 + 7
from collections import Counter
C = Counter(A)
for (k, v) in C.items():
	if v == 2:
		t = k
flag = False
for i in range(n + 1):
	if not flag:
		if A[i] == t:
			l = i
			flag = True
	elif A[i] == t:
		r = i
r = n - r
N = 10 ** 5 + 50
fac = [1] * (N + 1)
finv = [1] * (N + 1)
for i in range(N):
	fac[i + 1] = fac[i] * (i + 1) % mod
finv[-1] = pow(fac[-1], mod - 2, mod)
for i in reversed(range(N)):
	finv[i] = finv[i + 1] * (i + 1) % mod

def cmb1(n, r, mod):
	if r < 0 or r > n:
		return 0
	r = min(r, n - r)
	return fac[n] * finv[r] * finv[n - r] % mod
for k in range(1, n + 2):
	ans = cmb1(n + 1, k, mod) - cmb1(l + r, k - 1, mod)
	print(ans % mod)


from collections import defaultdict
import sys
input = sys.stdin.readline
(N, mod) = (10 ** 5 + 1, 10 ** 9 + 7)
fac = [1, 1] + [None] * N
inv = [0, 1] + [None] * N
facInv = [1, 1] + [None] * N
for i in range(2, N + 1):
	fac[i] = i * fac[i - 1] % mod
	inv[i] = mod - inv[mod % i] * (mod // i) % mod
	facInv[i] = facInv[i - 1] * inv[i] % mod

def modCom(n, k):
	return 0 if n < k else fac[n] * facInv[k] * facInv[n - k] % mod
n = int(input())
a = list(map(int, input().split()))
dic = defaultdict(int)
for (i, x) in enumerate(a):
	if dic[x] > 0:
		fi = dic[x]
		si = i + 1
		break
	dic[x] = i + 1
print(n)
for k in range(2, n + 1):
	print((modCom(n + 1, k) - modCom(fi + n - si, k - 1)) % mod)
print(1)


def mod_inv(n: int, mod: int) -> int:
	(b, u, v) = (mod, 1, 0)
	while b > 0:
		t = n // b
		n -= t * b
		u -= t * v
		(n, b) = (b, n)
		(u, v) = (v, u)
	return (u + mod) % mod

def _11(N: int, A: list) -> list:
	MOD = 10 ** 9 + 7
	d = {}
	(l, r) = (0, 0)
	for (i, a) in enumerate(A):
		if a in d:
			(l, r) = (d[a], N - i)
		else:
			d[a] = i
	(c1, c2) = ([1] * (N + 2), [1] * (N + 2))
	for i in range(N + 1):
		c1[i + 1] = c1[i] * (N + 1 - i) * mod_inv(i + 1, MOD) % MOD
		c2[i + 1] = c2[i] * (l + r - i) * mod_inv(i + 1, MOD) % MOD
	return [(c1[k + 1] - c2[k] + MOD) % MOD for k in range(N + 1)]
N = int(input())
A = [int(s) for s in input().split()]
ans = _11(N, A)
print('\n'.join(map(str, ans)))


from collections import defaultdict
n = int(input())
a = list(map(int, input().split()))
MOD = 10 ** 9 + 7
MAX = n + 5
fact = [1 for _ in range(MAX)]
finv = [1 for _ in range(MAX)]
for i in range(2, MAX):
	fact[i] = fact[i - 1] * i % MOD
	finv[i] = pow(fact[i], MOD - 2, MOD)

def comb(n: int, k: int) -> int:
	if n < k or n < 0 or k < 0:
		return 0
	return fact[n] * finv[k] % MOD * finv[n - k] % MOD
d = defaultdict(list)
for i in range(n + 1):
	d[a[i]].append(i)
	if len(d[a[i]]) == 2:
		(i1, i2) = sorted(d[a[i]])
		m1 = i1
		m2 = i2 - i1 - 1
		m3 = n - i2
ans = []
for k in range(1, n + 2):
	ansi = comb(n + 1, k) - comb(m1 + m3, k - 1)
	ansi = (ansi + MOD) % MOD
	ans.append(ansi)
for ansi in ans:
	print(ansi)


import collections
mod = 10 ** 9 + 7
n = int(input())
arr = list(map(int, input().split()))
cnt = collections.Counter(arr)
for key in cnt.keys():
	if cnt[key] == 2:
		K = key
pos1 = -1
pos2 = -1
for i in range(n + 1):
	if arr[i] == K:
		if pos1 == -1:
			pos1 = i
		else:
			pos2 = i
A = pos1
B = pos2 - pos1 - 1
C = n - pos2
facts = [1]
for i in range(1, n + 1):
	facts.append(facts[-1] * i % mod)
revfacts = [1]
for i in range(1, n + 1):
	revfacts.append(pow(facts[i], mod - 2, mod))
ans = []
for i in range(1, n + 2):
	ways1 = 0
	if i <= A + B + C:
		ways1 = facts[A + B + C] * revfacts[i] * revfacts[A + B + C - i] % mod
	ways2 = 0
	if i >= 2 and i - 2 <= A + B + C:
		ways2 = facts[A + B + C] * revfacts[i - 2] * revfacts[A + B + C - (i - 2)] % mod
	ways3 = 0
	if i >= 1 and i - 1 <= A + C:
		ways3 = facts[A + C] * revfacts[i - 1] * revfacts[A + C - (i - 1)] % mod
	ways4 = 0
	if i >= 1 and i - 1 <= A + B + C:
		ways4 = (2 * facts[A + B + C] * revfacts[i - 1] * revfacts[A + B + C - (i - 1)] - 2 * ways3) % mod
	ans.append((ways1 + ways2 + ways3 + ways4) % mod)
for val in ans:
	print(val)


n = int(input())
A = list(map(int, input().split()))
mod = 10 ** 9 + 7
d = {}
for i in range(n + 1):
	if A[i] not in d:
		d[A[i]] = i
	else:
		l = d[A[i]]
		r = i
		break

def cmb1(n, r, mod):
	if r < 0 or r > n:
		return 0
	r = min(r, n - r)
	return g1[n] * g2[r] * g2[n - r] % mod
mod = 10 ** 9 + 7
N = 10 ** 6
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]
for i in range(2, N + 1):
	g1.append(g1[-1] * i % mod)
	inverse.append(-inverse[mod % i] * (mod // i) % mod)
	g2.append(g2[-1] * inverse[-1] % mod)
for k in range(1, n + 2):
	ans = cmb1(n + 1, k, mod) - cmb1(l + n - r, k - 1, mod)
	print(ans % mod)


mod = 10 ** 9 + 7
fact = [1] * (10 ** 5 + 2)
for n in range(1, 10 ** 5 + 2):
	fact[n] = n * fact[n - 1] % mod

def com(n, k, m):
	return fact[n] * pow(fact[k], m - 2, m) * pow(fact[n - k], m - 2, m) % m
N = int(input())
A = list(map(int, input().split()))
c = [-1] * N
for i in range(N + 1):
	if c[A[i] - 1] != -1:
		break
	c[A[i] - 1] = i
j = c[A[i] - 1]
i = N - i
for k in range(1, N + 2):
	res = com(N + 1, k, mod)
	if k - 1 <= i + j:
		res -= com(i + j, k - 1, mod)
	print(res % mod)


MOD = 10 ** 9 + 7
(fact, invfact) = ([0] * (10 ** 5 + 2), [0] * (10 ** 5 + 2))
(fact[0], invfact[0]) = (1, 1)
for i in range(1, 10 ** 5 + 2):
	fact[i] = fact[i - 1] * i % MOD
	invfact[i] = pow(fact[i], MOD - 2, MOD)

def mod_comb(n, r):
	if n < r or n == 0 or r == 0:
		return 0
	return fact[n] * invfact[r] % MOD * invfact[n - r] % MOD
from collections import defaultdict
n = int(input())
a = list(map(int, input().split()))
d = defaultdict(int)
for (i, ele) in enumerate(a):
	if d[ele] == 0:
		d[ele] = i + 1
	else:
		l = d[ele]
		r = i + 1
print(n)
for k in range(2, n + 2):
	print((mod_comb(n + 1, k) - mod_comb(l - 1 + n - r + 1, k - 1)) % MOD)


n = int(input())
a = list(map(int, input().split()))
s = set()
index2 = 0
for i in range(n + 1):
	if a[i] in s:
		index2 = i
	s.add(a[i])
index1 = 0
for i in range(n + 1):
	if a[i] == a[index2]:
		index1 = i
		break
m = 10 ** 9 + 7
fac = [1, 1]
inv = [1, 1]
finv = [1, 1]
for i in range(2, n + 5):
	fac.append(fac[i - 1] * i % m)
	inv.append(m - inv[m % i] * (m // i) % m)
	finv.append(finv[i - 1] * inv[i] % m)

def nck(n, k):
	if n < k:
		return 0
	if n < 0 or k < 0:
		return 0
	return fac[n] * (finv[k] * finv[n - k] % m) % m
for k in range(1, n + 2):
	print((nck(n + 1, k) - nck(index1 + n - index2, k - 1)) % m)


from collections import Counter, defaultdict

class Combination:

	def __init__(self, size, mod=10 ** 9 + 7):
		self.size = size + 2
		self.mod = mod
		self.fact = [1, 1] + [0] * size
		self.factInv = [1, 1] + [0] * size
		self.inv = [0, 1] + [0] * size
		for i in range(2, self.size):
			self.fact[i] = self.fact[i - 1] * i % self.mod
			self.inv[i] = -self.inv[self.mod % i] * (self.mod // i) % self.mod
			self.factInv[i] = self.factInv[i - 1] * self.inv[i] % self.mod

	def npr(self, n, r):
		if n < r or n < 0 or r < 0:
			return 0
		return self.fact[n] * self.factInv[n - r] % self.mod

	def ncr(self, n, r):
		if n < r or n < 0 or r < 0:
			return 0
		return self.fact[n] * (self.factInv[r] * self.factInv[n - r] % self.mod) % self.mod

	def nhr(self, n, r):
		return self.ncr(n + r - 1, n - 1)

	def factN(self, n):
		if n < 0:
			return 0
		return self.fact[n]
N = int(input())
A = list(map(int, input().split()))
MOD = 10 ** 9 + 7
comb = Combination(N + 100)
cntA = Counter(A)
I = [a for (a, c) in list(cntA.items()) if c == 2][0]
(L, R) = [i for (i, a) in enumerate(A) if a == I]
S = L + (N - R)
for i in range(1, N + 2):
	if i == 1:
		print(N)
		continue
	ans = comb.ncr(N + 1, i) - comb.ncr(S, i - 1)
	print(ans % MOD)


import sys
from collections import Counter

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return list(map(int, input().split()))

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

class ModTools:

	def __init__(self, MAX, MOD):
		MAX += 1
		self.MAX = MAX
		self.MOD = MOD
		factorial = [1] * MAX
		factorial[0] = factorial[1] = 1
		for i in range(2, MAX):
			factorial[i] = factorial[i - 1] * i % MOD
		inverse = [1] * MAX
		inverse[MAX - 1] = pow(factorial[MAX - 1], MOD - 2, MOD)
		for i in range(MAX - 2, 0, -1):
			inverse[i] = inverse[i + 1] * (i + 1) % MOD
		self.fact = factorial
		self.inv = inverse

	def nCr(self, n, r):
		if n < r:
			return 0
		r = min(r, n - r)
		numerator = self.fact[n]
		denominator = self.inv[r] * self.inv[n - r] % self.MOD
		return numerator * denominator % self.MOD
N = INT()
A = LIST()
dup = 0
for (k, v) in list(Counter(A).items()):
	if v == 2:
		dup = k
		break
st = []
for (i, a) in enumerate(A):
	if a == dup:
		st.append(i)
M = N - (st[1] - st[0])
mt = ModTools(N + 1, MOD)
for i in range(N + 1):
	ans = mt.nCr(N + 1, i + 1) - mt.nCr(M, i)
	print(ans % MOD)


class ModComb:

	def __init__(self, MAX, mod=10 ** 9 + 7):
		fac = [1, 1]
		finv = [1, 1]
		inv = [0, 1]
		for i in range(2, MAX):
			fac.append(fac[i - 1] * i % mod)
			inv.append(mod - inv[mod % i] * (mod // i) % mod)
			finv.append(finv[i - 1] * inv[i] % mod)
		(self.fac, self.finv, self.mod) = (fac, finv, mod)

	def nCk(self, n, k):
		if n < k or n < 0 or k < 0:
			return 0
		(fac, finv, mod) = (self.fac, self.finv, self.mod)
		return fac[n] * (finv[k] * finv[n - k] % mod) % mod
mod = 10 ** 9 + 7
(N, *A) = map(int, open(0).read().split())
mc = ModComb(10 ** 5 + 5, mod=mod)
used = {}
(left, right) = (0, 0)
for (i, a) in enumerate(A):
	if a in used:
		right = i
		left = used[a]
		break
	used[a] = i
m = left + N - right
for k in range(1, N + 2):
	print((mc.nCk(N + 1, k) - mc.nCk(m, k - 1)) % mod)


class Factorial:

	def __init__(self, n, mod=10 ** 9 + 7):
		self.fac = [0] * (n + 1)
		self.ifac = [0] * (n + 1)
		self.fac[0] = 1
		self.ifac[0] = 1
		self.mod = mod
		modmod = self.mod - 2
		for i in range(n):
			self.fac[i + 1] = self.fac[i] * (i + 1) % self.mod
			self.ifac[i + 1] = self.ifac[i] * pow(i + 1, modmod, self.mod) % self.mod

	def comb(self, n, r):
		if n == 0 and r == 0:
			return 1
		if n < r or n < 0:
			return 0
		tmp = self.ifac[n - r] * self.ifac[r] % self.mod
		return tmp * self.fac[n] % self.mod

	def perm(self, n, r):
		if n == 0 and r == 0:
			return 1
		if n < r or n < 0:
			return 0
		return self.fac[n] * self.ifac[n - r] % self.mod
n = int(input())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7
d = {}
for i in range(0, n + 1):
	if a[i] not in d:
		d[a[i]] = i
	else:
		(l, r) = (d[a[i]], n - i)
		break
fact = Factorial(n + 1)
for i in range(1, n + 2):
	ans = fact.comb(n + 1, i)
	s = fact.comb(l + r, i - 1)
	ans -= s
	while ans < 0:
		ans += mod
	print(ans)


from collections import Counter
N = int(input())
A = list(map(int, input().split()))
mod = 10 ** 9 + 7
factorial = [1]
inverse = [1]
for i in range(1, N + 2):
	factorial.append(factorial[-1] * i % mod)
	inverse.append(pow(factorial[-1], mod - 2, mod))

def nCr(n, r):
	if n < r or r < 0:
		return 0
	elif r == 0:
		return 1
	return factorial[n] * inverse[r] * inverse[n - r] % mod
X = Counter(A).most_common(1)[0][0]
X_index = []
for (i, a) in enumerate(A, start=1):
	if a == X:
		X_index.append(i)
(L, R) = (X_index[0], X_index[1])
for k in range(1, N + 2):
	if k == 1:
		print(N)
	else:
		print((nCr(N + 1, k) - nCr(N - R + L, k - 1)) % mod)