AtCoder Beginner Contest 066 - 11

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

Starter code:

Solutions:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 9)
MOD = 10 ** 9 + 7

class Factorial:

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

	def factorial(self, j):
		return self.f[j]

	def ifactorial(self, j):
		return self.i[j]

	def comb(self, n, k):
		return self.f[n] * self.i[n - k] % self.mod * self.i[k] % self.mod if n >= k else 0
N = int(input())
A = list(map(int, input().split()))
lst = [-1] * (N + 1)
for i in range(N + 1):
	a = A[i]
	if lst[a] == -1:
		lst[a] = i
	else:
		left = lst[a]
		right = i
		break
F = Factorial(N + 1, MOD).comb
for i in range(1, N + 2):
	if left + N - right >= i - 1:
		tmp = F(N + 1, i) - F(left + (N - right), i - 1)
	else:
		tmp = F(N + 1, i)
	print(tmp % MOD)


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)


m = 10 ** 9 + 7
n = int(input())
a = list(map(int, input().split()))
b = [0] * (n + 1)
for i in range(n + 1):
	if b[a[i]] == 0:
		b[a[i]] = i + 1
	else:
		s = b[a[i]] + n - i - 1
		break
(p, q) = (1, 1)
for i in range(1, n + 2):
	p = p * (n + 2 - i) * pow(i, m - 2, m) % m
	q = 1 if i == 1 and s >= i - 1 else (0 if s < i - 1 else q * (s - i + 2) * pow(i - 1, m - 2, m)) % m
	print((p - q) % m)


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())
a = list(map(int, input().split()))
table = [-1] * (N + 1)
d = [0, 0]
mod = 10 ** 9 + 7

class Factorial:

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

	def factorial(self, i):
		return self.f[i]

	def ifactorial(self, i):
		return self.i[i]

	def combi(self, n, k):
		return self.f[n] * self.i[n - k] % mod * self.i[k] % mod
f = Factorial(N + 1, mod)
for i in range(N + 1):
	if table[a[i]] != -1:
		d = [table[a[i]], i]
		break
	table[a[i]] = i
for i in range(1, N + 2):
	x = f.combi(N + 1, i)
	w = 0
	if N + d[0] - d[1] >= i - 1:
		w = f.combi(d[0] + N - d[1], i - 1)
	print((x - w) % mod)


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)


n = int(input())
a = [int(x) for x in input().split()]
mod = 10 ** 9 + 7

class Comb(object):

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

	def calc(self, n, k):
		if n >= k:
			return self.fac[n] * self.inv[k] * self.inv[n - k]
		else:
			return 0
c = [0] * (n + 1)
indexes = [[] for _ in range(n + 1)]
for i in range(n + 1):
	c[a[i]] += 1
	indexes[a[i]].append(i)
	if c[a[i]] == 2:
		indexes = indexes[a[i]]
		break
m = indexes[0] + (n - indexes[1])
comb = Comb(n + 1)
for k in range(1, n + 2):
	x = comb.calc(n + 1, k)
	y = comb.calc(m, k - 1)
	ans = (x - y) % mod
	print(ans)


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()


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

def div_mod(a, b, p):
	return a * pow(b, p - 2, p) % p
factorial_memo = [1]
for i in range(1, n + 2):
	factorial_memo.append(factorial_memo[-1] * i % MOD)

def comb_mod(n, r, mod):
	if n < r:
		return 0
	return div_mod(div_mod(factorial_memo[n], factorial_memo[n - r], mod), factorial_memo[r], mod)
indices = [-1] * (n + 1)
for i in range(n + 1):
	if indices[a[i]] == -1:
		indices[a[i]] = i
	else:
		f_idx = indices[a[i]]
		s_idx = i
		break
for k in range(1, n + 2):
	all_pattern = comb_mod(n + 1, k, MOD)
	dup_pattern = comb_mod(f_idx + (n - s_idx), k - 1, MOD)
	print((all_pattern - dup_pattern) % MOD)


(N, *X) = map(int, open(0).read().split())
MAX = 10 ** 5 + 1
MOD = 10 ** 9 + 7
fac = [0] * (MAX + 1)
fac[0] = 1
fac[1] = 1
for i in range(2, MAX + 1):
	fac[i] = fac[i - 1] * i % MOD
finv = [0] * (MAX + 1)
finv[MAX] = pow(fac[MAX], MOD - 2, MOD)
for i in reversed(range(1, MAX + 1)):
	finv[i - 1] = finv[i] * i % MOD

def comb(n, k):
	if n < k:
		return 0
	return fac[n] * finv[n - k] * finv[k]
indices = [-1] * (N + 1)
for i in range(N + 1):
	if indices[X[i]] < 0:
		indices[X[i]] = i
	else:
		l = indices[X[i]]
		r = i
		break
for k in range(1, N + 2):
	print((comb(N + 1, k) - comb(l + N - r, k - 1)) % MOD)


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())
arr = list(map(int, input().split()))
cnt = [-1] * (n + 1)
mod = 10 ** 9 + 7
fact = [1]
now = 1
for i in range(1, n + 2):
	now = now % mod * (i % mod)
	now = now % mod
	fact.append(now)
inverse = []
for i in range(n + 2):
	inverse.append(pow(fact[i], mod - 2, mod))
(l, r) = (0, 0)
for i in range(0, n + 1):
	if cnt[arr[i]] != -1:
		l = cnt[arr[i]]
		r = i
		break
	cnt[arr[i]] = i
for i in range(1, n + 2):
	ans = fact[n + 1] * inverse[i] * inverse[n + 1 - i] % mod
	rem = n - r + l
	if rem >= i - 1:
		ans = ans - fact[rem] * inverse[i - 1] * inverse[rem - (i - 1)] % mod + mod
		ans = ans % mod
	print(ans)


(n, *a) = map(int, open(0).read().split())
b = {}
M = 10 ** 9 + 7
for (i, x) in enumerate(a):
	b.setdefault(x, []).append(i)
p = n + 1
q = r = 1
d = [abs(j[0] - j[1]) for (x, j) in b.items() if len(j) > 1][0]
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


def memfact(a, m):
	temp = 1
	yield temp
	for i in range(1, a + 1):
		temp = temp * i % m
		yield temp

def comb(n, r, m):
	if r == 0:
		return 1
	return memf[n] * pow(memf[r], m - 2, m) * pow(memf[n - r], m - 2, m) % m
(n, *a) = map(int, open(0).read().split())
m = 1000000007
checker = set()
for i in range(n + 1):
	if a[i] in checker:
		left = a.index(a[i])
		right = n - i
		break
	else:
		checker.add(a[i])
memf = []
mfappend = memf.append
for x in memfact(n + 1, m):
	mfappend(x)
lr = left + right
for i in range(1, n + 2):
	ans = comb(n + 1, i, m)
	if i <= lr + 1:
		ans = (ans - comb(lr, i - 1, m)) % m
	print(ans)


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

def cmb(n, r):
	if n < 0 or r < 0 or r > n:
		return 0
	return fac[n] * inv_fac[r] % MOD * inv_fac[n - r] % MOD
N = int(input())
A = list(map(int, input().split()))
used = [0] * N
for i in range(N + 1):
	a = A[i]
	if used[a - 1] == 0:
		used[a - 1] = [1, i]
	else:
		x = a
		y = used[a - 1][1]
		z = i
		break
print(N)
for i in range(2, N + 2):
	ans = cmb(N + 1, i) - cmb(N - z + y, i - 1)
	print(ans % MOD)


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

def init(n):
	global factorial, inverse
	factorial = [1] * (n + 1)
	inverse = [1] * (n + 1)
	fact = 1
	for p in range(1, n + 1):
		fact *= p
		fact %= mod
		factorial[p] = fact
	inv = pow(fact, mod - 2, mod)
	inverse[n] = inv
	for p in range(2, n + 1)[::-1]:
		inv *= p
		inv %= mod
		inverse[p - 1] = inv

def comb(n, r):
	if n < r:
		return 0
	return factorial[n] * inverse[n - r] * inverse[r] % mod
n = int(input())
a = list(map(int, input().split()))
b = Counter(a).most_common()[0][0]
pos = []
for (i, ai) in enumerate(a):
	if ai == b:
		pos.append(i)
(l, r) = pos
(L, R) = (l, n - r)
init(n + 1)
for k in range(1, n + 2):
	ans = (comb(n + 1, k) - comb(L + R, k - 1)) % mod
	print(ans)


import sys
finput = lambda : sys.stdin.readline().strip()

def main():
	p = 10 ** 9 + 7
	n = int(finput())
	a = list(map(int, finput().split()))
	k = sum(a) - n * (n + 1) // 2
	pk = [i for i in range(n + 1) if a[i] == k]
	fact = [1] * (n + 2)
	ifact = [1] * (n + 2)
	for i in range(1, n + 2):
		fact[i] = fact[i - 1] * i % p
	a = fact[-1]
	inv = 1
	m = p - 2
	while m > 0:
		if m & 1:
			inv = a * inv % p
		m >>= 1
		a = a * a % p
	ifact[-1] = inv
	for i in range(n + 1, 0, -1):
		ifact[i - 1] = ifact[i] * i % p
	ans0 = [0] * (n + 2)
	ans1 = [0] * (n + 2)
	ans2 = [0] * (n + 2)
	for i in range(n):
		ans0[i] = fact[n - 1] * ifact[n - i - 1] * ifact[i] % p
		ans1[i + 1] = ans0[i] * 2
		ans2[i + 2] = ans0[i]
	sn = pk[0] + n - pk[1]
	for i in range(sn + 1):
		ans1[i + 1] -= fact[sn] * ifact[sn - i] * ifact[i] % p
	for i in range(1, n + 2):
		print((ans0[i] + ans1[i] + ans2[i]) % p)

def __starting_point():
	main()
__starting_point()


class Factorial:

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

	def factorial(self, i):
		return self.f[i]

	def ifactorial(self, i):
		return self.i[i]

	def comb(self, n, k):
		return self.f[n] * self.i[n - k] % self.mod * self.i[k] % self.mod if n >= k else 0
from collections import *
M = 10 ** 9 + 7
(n, *a) = map(int, open(0).read().split())
(v, _) = Counter(a).most_common(1)[0]
l = -1
for (i, b) in enumerate(a):
	if b == v:
		if l < 0:
			l = i
		else:
			r = n - i
c = Factorial(n + 1, M).comb
for k in range(n + 1):
	print((c(n + 1, k + 1) - c(l + r, k)) % M)


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

def modinv(x):
	return pow(x, mod - 2, mod)
for (k, v) in cnt.items():
	if v == 1:
		continue
	for i in range(n + 1):
		if a[i] == k:
			left = i
			break
	for i in range(n, -1, -1):
		if a[i] == k:
			right = n - i
			break
	break
allcomb = 1
lrcomb = [1] * (n + 1)
for i in range(1, n + 1):
	lrcomb[i] = (left + right - i + 1) * modinv(i) * lrcomb[i - 1]
	lrcomb[i] %= mod
for k in range(1, n + 2):
	allcomb *= (n - k + 2) * modinv(k)
	allcomb %= mod
	if left + right >= k - 1:
		print((allcomb - lrcomb[k - 1]) % mod)
	else:
		print(allcomb)


def factorial_memo(n, p):
	F = [1] * (n + 1)
	for i in range(n):
		F[i + 1] = F[i] * (i + 1) % p
	return F

def inverse(F, p):
	Finv = [x for x in F]
	Finv[-1] = pow(Finv[-1], p - 2, p)
	for i in range(len(F) - 2, 0, -1):
		Finv[i] = Finv[i + 1] * (i + 1) % p
	return Finv

def comb(a, b):
	if a < b:
		return 0
	return F[a] * Finv[a - b] * Finv[b] % p
n = int(input())
A = [int(x) for x in input().split()]
p = 10 ** 9 + 7
D = [-1] * n
double = [-1, -1]
for (i, a) in enumerate(A):
	if D[a - 1] == -1:
		D[a - 1] = i
	else:
		double = [D[a - 1], i]
		break
F = factorial_memo(n + 1, p)
Finv = inverse(F, p)
n_a = double[0]
n_b = n - double[1]
print(n)
C = [0] * n
for i in range(2, n + 2):
	cnt = (comb(n + 1, i) - comb(n_a + n_b, i - 1)) % p
	print(cnt)


from collections import *
from itertools import *
from bisect import *
from heapq import *
import copy
import math
from fractions import gcd
import sys
N = int(input())
A = list(map(int, input().split()))
if N == 1:
	print(1)
	print(1)
	exit()
mod = 10 ** 9 + 7
fac = [1, 1]
for i in range(2, N + 2):
	fac.append(fac[i - 1] * i % mod)
ifac = [pow(i, mod - 2, mod) for i in fac]

def comb(a, b):
	if a < b:
		return 0
	if a == 0 or b == 0:
		return 1
	return fac[a] * ifac[a - b] * ifac[b] % mod
data = [[] for i in range(N + 1)]
for i in range(len(A)):
	data[A[i]].append(i)
(a, b) = [i for i in data if len(i) >= 2][0]
z = a + len(A) - b - 1
for n in range(1, N + 2):
	print((comb(N + 1, n) - comb(z, n - 1)) % mod)


mod = 10 ** 9 + 7

def inv(x):
	m = mod
	u = 1
	v = 0
	while m:
		t = x // m
		x -= t * m
		(x, m) = (m, x)
		u -= t * v
		(u, v) = (v, u)
	return u % mod
n = int(input())
fac = [1]
for i in range(1, n + 2):
	fac.append(fac[i - 1] * i % mod)
a = list(map(int, input().split()))
num = [0] * (n + 1)
for x in a:
	num[x] += 1
two = -1
for (i, c) in enumerate(num):
	if c == 2:
		two = i
		break
l = -1
r = -1
for i in range(n + 1):
	if l == -1 and a[i] == two:
		l = i
	elif l != -1 and a[i] == two:
		r = n - i
for k in range(1, n + 2):
	if k - 1 <= l + r:
		print((fac[n + 1] * inv(fac[k] * fac[n + 1 - k]) - fac[l + r] * inv(fac[k - 1] * fac[l + r - k + 1])) % mod)
	else:
		print(fac[n + 1] * inv(fac[k] * fac[n + 1 - k]) % mod)


mod = 10 ** 9 + 7
N = int(input())
Factorial = [1] * (N + 1)
for i in range(1, N + 1):
	Factorial[i] = Factorial[i - 1] * i % mod

def power(x, y):
	if y == 0:
		return 1
	elif y == 1:
		return x % mod
	elif y % 2 == 0:
		return power(x, y // 2) ** 2 % mod
	else:
		return power(x, y // 2) ** 2 * x % mod
inverseFactorial = [1] * (N + 1)
inverseFactorial[N] = power(Factorial[N], mod - 2)
for i in range(0, N)[::-1]:
	inverseFactorial[i] = inverseFactorial[i + 1] * (i + 1) % mod

def comb(x, y):
	if x < y or y < 0:
		return 0
	else:
		return Factorial[x] * inverseFactorial[y] * inverseFactorial[x - y] % mod
list = [-1] * N
n = 0
for i in input().split():
	if list[int(i) - 1] < 0:
		list[int(i) - 1] = n
		n += 1
	else:
		a = list[int(i) - 1]
		b = n - a - 1
		c = N - n
for m in range(1, N + 2):
	print((comb(a + b + c, m) + 2 * comb(a + b + c, m - 1) - comb(a + c, m - 1) + comb(a + b + c, m - 2)) % mod)


import sys
input = sys.stdin.readline

def main():
	N = int(input())
	a = list(map(int, input().split()))
	kai = [1] * (N + 2)
	MOD = int(1000000000.0) + 7
	for i in range(1, N + 2):
		kai[i] *= kai[i - 1] * i
		kai[i] %= MOD
	dic = {}
	for i in range(N + 1):
		if a[i] in dic:
			left = dic[a[i]]
			right = N - i
		else:
			dic[a[i]] = i
	for i in range(1, N + 2):
		tmp = kai[N + 1] * pow(kai[N + 1 - i], MOD - 2, MOD) * pow(kai[i], MOD - 2, MOD)
		tmp %= MOD
		if i - 1 <= left + right:
			tmp2 = kai[left + right] * pow(kai[left + right + 1 - i], MOD - 2, MOD) * pow(kai[i - 1], MOD - 2, MOD)
			tmp2 %= MOD
			tmp = (tmp + MOD - tmp2) % MOD
		print(tmp)
main()


n = int(input())
As = list(map(int, input().split()))
M = [-1] * n
(p, q) = (0, 1)
for i in range(n + 1):
	A = As[i]
	A = A - 1
	if not M[A] < 0:
		(p, q) = (M[A], i)
		break
	M[A] = i
MAX = 200000
MOD = 1000000007
fac = [0] * MAX
finv = [0] * MAX
inv = [0] * MAX
fac[0] = 1
fac[1] = 1
finv[0] = 1
finv[1] = 1
inv[1] = 1
for i in range(2, MAX):
	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 COM(n, k):
	if n < 0 or k < 0 or n < k:
		return 0
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD
for k in range(1, n + 2):
	r1 = COM(n + 1, k)
	r2 = COM(n + p - q, k - 1)
	r = (r1 - r2) % MOD
	print(r)


n = int(input())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7
modp = mod
max_n = 2 * 10 ** 5
fact = [1, 1] + [0] * max_n
factinv = [1, 1] + [0] * max_n
inv = [0, 1] + [0] * max_n

def cmb(n, r, p):
	assert n < p, 'n is less than modp'
	assert n < max_n, 'n in less than max_n'
	if r < 0 or n < r:
		return 0
	r = min(r, n - r)
	return fact[n] * factinv[r] * factinv[n - r] % p
for i in range(2, max_n + 1):
	fact[i] = fact[i - 1] * i % modp
	inv[i] = -inv[modp % i] * (modp // i) % modp
	factinv[i] = factinv[i - 1] * inv[i] % modp
counter = [0] * n
for i in range(n + 1):
	counter[a[i] - 1] += 1
	if counter[a[i] - 1] == 2:
		second = i
		first = a.index(a[i])
		break
ans = [cmb(n + 1, i, mod) for i in range(1, n + 2)]
n_left = first
n_right = n - second
n_lr = n_left + n_right
doubled = [1] + [cmb(n_lr, i, mod) for i in range(1, n_lr + 1)]
for i in range(n_lr + 1):
	ans[i] = (ans[i] - doubled[i]) % mod
for i in range(len(ans)):
	print(ans[i])


n = int(input())
a = list(map(int, input().split()))
D = {i: [0] for i in range(1, n + 1)}
for i in range(n + 1):
	D[a[i]][0] += 1
	D[a[i]].append(i)
(pl, pr) = (0, 0)
for i in D:
	if D[i][0] == 2:
		pl = D[i][1]
		pr = D[i][2]
		break
L = pl
M = pr - pl - 1
N = n - pr
mod = int(1000000000.0) + 7
maxf = n + 11

def make_fact(n, k):
	tmp = n
	perm = [i for i in range(k)]
	L = [0 for _ in range(k)]
	for i in range(k):
		L[i] = tmp % (i + 1)
		tmp //= i + 1
	LL = [0 for _ in range(k)]
	for i in range(k):
		LL[i] = perm[L[-i - 1]]
		for j in range(L[-i - 1] + 1, k):
			perm[j - 1] = perm[j]
	return LL

def doubling(n, m, modulo=mod):
	y = 1
	base = n
	tmp = m
	while tmp != 0:
		if tmp % 2 == 1:
			y *= base
			if modulo > 0:
				y %= modulo
		base *= base
		if modulo > 0:
			base %= modulo
		tmp //= 2
	return y

def inved(a, modulo=mod):
	(x, y, u, v, k, l) = (1, 0, 0, 1, a, modulo)
	while l != 0:
		(x, y, u, v) = (u, v, x - u * (k // l), y - v * (k // l))
		(k, l) = (l, k % l)
	return x % modulo
fact = [1 for _ in range(maxf + 1)]
invf = [1 for _ in range(maxf + 1)]
for i in range(maxf):
	fact[i + 1] = fact[i] * (i + 1) % mod
invf[-1] = inved(fact[-1])
for i in range(maxf, 0, -1):
	invf[i - 1] = invf[i] * i % mod
for i in range(1, n + 2):
	S = fact[n + 1] * invf[i] * invf[n - i + 1] % mod
	if i <= n - M:
		S -= fact[n - 1 - M] * invf[i - 1] * invf[n - M - i] % mod
		S %= mod
	print(S)


def comb(n, k):
	if n < k or n == 0:
		return 0
	elif k == 0:
		return 1
	else:
		return f[n] * p[k] * p[n - k] % (10 ** 9 + 7)
from collections import Counter
n = int(input())
print(n)
a = [int(i) for i in input().split()]
twice = Counter(a).most_common(1)[0][0]
(x, y) = (i for (i, j) in enumerate(a) if j == twice)
(num, y, f, p) = (1, n - y, [1], [1])
for i in range(1, n + 2):
	f.append(f[-1] * i % (10 ** 9 + 7))
	p.append(pow(f[-1], 10 ** 9 + 5, 10 ** 9 + 7))
for i in range(2, x + y + 2):
	print((comb(n + 1, i) - comb(x + y, i - 1)) % (10 ** 9 + 7))
for i in range(x + y + 2, n + 2):
	print(comb(n + 1, i))


def cmb(n, k, mod, fac, ifac):
	k = min(k, n - k)
	return fac[n] * ifac[k] % mod * ifac[n - k] % mod if n >= k >= 0 else 0

def make_tables(mod, n):
	fac = [1, 1]
	ifac = [1, 1]
	inverse = [0, 1]
	for i in range(2, n + 1):
		fac.append(fac[-1] * i % mod)
		inverse.append(-inverse[mod % i] * (mod // i) % mod)
		ifac.append(ifac[-1] * inverse[-1] % mod)
	return (fac, ifac)
N = int(input())
A = list(map(int, input().split()))
MOD = 10 ** 9 + 7
(fac, ifac) = make_tables(MOD, N + 1)
ans = 0
INF = 10 ** 9
(x, y) = (0, 0)
l = [INF] * (N + 1)
for i in range(N + 1):
	if l[A[i] - 1] != INF:
		x = l[A[i] - 1]
		y = i + 1
		break
	l[A[i] - 1] = i + 1
for i in range(1, N + 2):
	print((cmb(N + 1, i, MOD, fac, ifac) - cmb(N + x - y, i - 1, MOD, fac, ifac)) % MOD)


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

def ncr(n, r):
	if not n >= r >= 0:
		return 0
	else:
		return up[n] * down[n - r] * down[r] % mod
(duplicated_number, _cnt) = Counter(a).most_common()[0]
index_que = []
for i in range(N + 1):
	if a[i] == duplicated_number:
		index_que.append(i)
(A, B) = (min(index_que), max(index_que))
for k in range(1, N + 2):
	if k == 1:
		print(N)
	else:
		ans = ncr(N - 1, k - 2) + ncr(N - 1, k) + 2 * ncr(N - 1, k - 1) - ncr(N - B + A, k - 1)
		print(ans % mod)


import sys
import numpy as np
sr = lambda : sys.stdin.readline().rstrip()
ir = lambda : int(sr())
lr = lambda : list(map(int, sr().split()))
MOD = 10 ** 9 + 7

def cmb(n, k):
	if k > n:
		return 0
	return fact[n] * fact_inv[k] % MOD * fact_inv[n - k] % MOD

def cumprod(arr, MOD):
	L = len(arr)
	Lsq = int(L ** 0.5 + 1)
	arr = np.resize(arr, Lsq ** 2).reshape(Lsq, Lsq)
	for n in range(1, Lsq):
		arr[:, n] *= arr[:, n - 1]
		arr[:, n] %= MOD
	for n in range(1, Lsq):
		arr[n] *= arr[n - 1, -1]
		arr[n] %= MOD
	return arr.ravel()[:L]

def make_fact(U, MOD):
	x = np.arange(U, dtype=np.int64)
	x[0] = 1
	fact = cumprod(x, MOD)
	x = np.arange(U, 0, -1, dtype=np.int64)
	x[0] = pow(int(fact[-1]), MOD - 2, MOD)
	fact_inv = cumprod(x, MOD)[::-1]
	return (fact, fact_inv)
U = 10 ** 5 + 10
(fact, fact_inv) = make_fact(U, MOD)
N = ir()
A = lr()
double = 0
used = set()
for (i, a) in enumerate(A):
	if a in used:
		double = a
		index_back = i
		break
	used.add(a)
index_front = A.index(double)
x = N + 1 - (index_back - index_front)
print(N)
for i in range(2, N + 1):
	answer = cmb(N + 1, i) - cmb(x - 1, i - 1)
	print(answer % MOD)
print(1)


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

def nCk(n, k):
	if n < k:
		return 0
	return facts[n] * pow(facts[k], MOD - 2, MOD) % MOD * pow(facts[n - k], MOD - 2, MOD) % MOD
n = int(input())
a = list(map(int, input().split()))
indexes = [[] for _ in range(n + 1)]
for i in range(n + 1):
	indexes[a[i]].append(i)
for idx in indexes:
	if len(idx) == 2:
		idxs = sorted(idx)
for k in range(1, n + 1 + 1):
	p_all = nCk(n + 1, k)
	p_double = nCk(n + 1 - (idxs[1] - idxs[0] + 1), k - 1)
	print((p_all - p_double) % MOD)


import sys
from collections import Counter
MOD = 1000000007

def solve(n: int, a: 'List[int]'):
	counter = Counter(a).most_common()
	twiceValue = counter[0][0]
	first_index = None
	second_index = None
	for i in range(n + 1):
		if a[i] == twiceValue:
			if first_index == None:
				first_index = i
			else:
				second_index = i
	left = first_index
	right = n - second_index
	edge = left + right
	combination_table = {n + 1: [0] * (n + 2), edge: [0] * (edge + 1)}
	combination_table[n + 1][0] = 1
	combination_table[n + 1][n + 1] = 1
	combination_table[edge][0] = 1
	combination_table[edge][edge] = 1
	c_value = 1
	for i in range(1, n + 1):
		c_value *= (n + 1 + 1 - i) * pow(i, MOD - 2, MOD)
		c_value %= MOD
		combination_table[n + 1][i] = c_value
	c_value = 1
	for i in range(1, edge):
		c_value *= (edge + 1 - i) * pow(i, MOD - 2, MOD)
		c_value %= MOD
		combination_table[edge][i] = c_value
	for i in range(1, n + 2):
		if i - 1 <= edge:
			value = combination_table[n + 1][i] - combination_table[edge][i - 1]
		else:
			value = combination_table[n + 1][i]
		print(value % MOD)
	return

def main():

	def iterate_tokens():
		for line in sys.stdin:
			for word in line.split():
				yield word
	tokens = iterate_tokens()
	n = int(next(tokens))
	a = [int(next(tokens)) for _ in range(n + 1)]
	solve(n, a)

def __starting_point():
	main()
__starting_point()


def exteuc(a, b):
	if b == 0:
		return (1, 0, a)
	(y, x, v) = exteuc(b, a % b)
	y -= a // b * x
	return (x, y, v)

def modinv(a, mod):
	(x, _, _) = exteuc(a, mod)
	return x % mod

def main():
	MOD = 10 ** 9 + 7
	N = int(input())
	A = list(map(int, input().split(' ')))
	(dup_first_index, dup_second_index) = (-1, -1)
	indices = [-1 for _ in range(N)]
	for (i, a) in enumerate(A):
		if indices[a - 1] != -1:
			(dup_first_index, dup_second_index) = (indices[a - 1], i)
			break
		indices[a - 1] = i
	s = dup_first_index + N - dup_second_index
	ans = [0 for _ in range(N + 1)]
	(comb_n1, comb_s) = (N + 1, 1)
	for i in range(N + 1):
		ans[i] = comb_n1
		comb_n1 *= N + 1 - (i + 1)
		comb_n1 *= modinv(i + 2, MOD)
		comb_n1 %= MOD
		if s >= i:
			ans[i] -= comb_s
			comb_s *= s - i
			comb_s *= modinv(i + 1, MOD)
			comb_s %= MOD
		ans[i] %= MOD
	for a in ans:
		print(a)

def __starting_point():
	main()
__starting_point()


def cmb(n, k):
	if n < k:
		return 0
	return fac[n] * inv_fac[n - k] * inv_fac[k] % mod
fac = [1]
mod = 10 ** 9 + 7
n = int(input())
a = list(map(int, input().split()))
for i in range(1, n + 2):
	fac.append(fac[-1] * i % mod)
inv_fac = [pow(fac[n + 1], mod - 2, mod)]
for i in range(1, n + 2)[::-1]:
	inv_fac.append(inv_fac[-1] * i % mod)
inv_fac = inv_fac[::-1]
s = set()
num = -1
for i in range(n + 1):
	if a[i] in s:
		idx2 = i
		num = a[i]
		break
	s.add(a[i])
for i in range(n + 1):
	if a[i] == num:
		idx1 = i
		break
for i in range(1, n + 2):
	ans = cmb(n + 1, i)
	ans -= cmb(n + idx1 - idx2, i - 1)
	ans %= mod
	print(ans)


from collections import Counter
mod = 10 ** 9 + 7
rng = 100002
fctr = [1]
finv = [1]
for i in range(1, rng):
	fctr.append(fctr[-1] * i % mod)
for i in range(1, rng):
	finv.append(pow(fctr[i], mod - 2, mod))

def cmb(n, k):
	if n <= 0 or k < 0 or n < k:
		return 0
	else:
		return fctr[n] * finv[n - k] * finv[k] % mod
n = int(input())
a = list(map(int, input().split()))
same = []
c = Counter(a)
x = c.most_common()[0][0]
for i in range(n + 1):
	if a[i] == x:
		same.append(i + 1)
y = same[1] - same[0] + 1
print(n)
for k in range(2, n + 2):
	print((cmb(n + 1, k) - cmb(n + 1 - y, k - 1)) % mod)


mod = 1000000007
n = int(input())
a = list(map(int, input().split()))
check = [0] * (n + 1)
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]
for i in range(2, n + 1 + 1):
	g1.append(g1[-1] * i % mod)
	inverse.append(-inverse[mod % i] * (mod // i) % mod)
	g2.append(g2[-1] * inverse[-1] % mod)

def cmb2(n, r):
	mod = 1000000007
	if r < 0 or r > n:
		return 0
	r = min(r, n - r)
	return g1[n] * g2[r] * g2[n - r] % mod
r = -1
jn = -1
for i in range(n + 1):
	check[a[i] - 1] += 1
	if check[a[i] - 1] == 2:
		(jn, r) = (a[i], i)
		break
l = a.index(jn)
s = min(l, n - r)
t = max(l, n - r)
print(n)
for p in range(2, n + 1):
	w2 = cmb2(n + 1, p)
	y2 = cmb2(s + t, p - 1)
	print((w2 + mod - y2) % mod)
print(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 = 10 ** 5 + 1
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 = list(map(int, input().split()))
val = sum(A) - sum(set(A))
i = -1
j = -1
for k in range(n + 1):
	if A[k] == val:
		if i == -1:
			i = k
		elif j == -1:
			j = k
			break
for k in range(1, n + 2):
	print((cmb(n + 1, k, mod) - cmb(n + i - j, k - 1, mod)) % mod)


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')


def extgcd(a, b):
	r = [1, 0, a]
	w = [0, 1, b]
	while w[2] != 1:
		q = r[2] // w[2]
		r2 = w
		w2 = [r[0] - q * w[0], r[1] - q * w[1], r[2] - q * w[2]]
		r = r2
		w = w2
	return [w[0], w[1]]

def mod_inv(a, mod):
	x = extgcd(a, mod)[0]
	return (mod + x % mod) % mod
n = int(input())
mod = 10 ** 9 + 7
a = list(map(int, input().split()))
il = [[] for i in range(n)]
for i in range(n + 1):
	il[a[i] - 1].append(i)
	if len(il[a[i] - 1]) > 1:
		(p, q) = il[a[i] - 1]
comb = 1
comb2 = 1
c = p + n - q
for i in range(n + 1):
	comb = comb * (n + 1 - i) % mod * mod_inv(i + 1, mod) % mod
	if c >= i:
		print((comb - comb2) % mod)
		comb2 = comb2 * (c - i) % mod * mod_inv(i + 1, mod) % mod
	else:
		print(comb % mod)


m = 10 ** 9 + 7
N = int(input())
A = list(map(int, input().split()))
B = (N + 1) * [0]
for n in range(N + 1):
	if B[A[n]] == 0:
		B[A[n]] = n + 1
	else:
		S = B[A[n]] + N - n - 1
		break
p = 1
q = 1
for n in range(1, N + 2):
	p = p * (N + 2 - n) * pow(n, m - 2, m) % m
	q = 1 if n == 1 and S >= n - 1 else (0 if S < n - 1 else q * (S - n + 2) * pow(n - 1, m - 2, m)) % m
	print((p - q) % m)


n = int(input())
a = [int(i) for i in input().split()]
mod = 10 ** 9 + 7
fac = [1]
inv = [1]
for i in range(1, n + 2):
	fac.append(fac[-1] * i % mod)
	inv.append(pow(fac[-1], mod - 2, mod))
visited = [-1] * (n + 1)
for (i, aa) in enumerate(a):
	if visited[aa] < 0:
		visited[aa] = i
	else:
		(l, r) = (visited[aa], i)
		break

def comb(n, r):
	if n < r or r < 0:
		return 0
	return fac[n] * inv[n - r] * inv[r] % mod
for i in range(1, n + 2):
	print((comb(n + 1, i) - comb(n + l - r, i - 1)) % mod)


N = int(input())
d = {i: -1 for i in range(1, N + 1)}
(*l,) = map(int, input().split())
MOD = 10 ** 9 + 7
n = N + 1
fac = [1] * (n + 1)
rev = [1] * (n + 1)
for i in range(1, n + 1):
	fac[i] = i * fac[i - 1] % MOD
	rev[i] = pow(fac[i], MOD - 2, MOD)
comb = lambda a, b: fac[a] * rev[a - b] * rev[b] % MOD if a >= b else 0
for (i, j) in enumerate(l):
	if d[j] != -1:
		break
	d[j] = i
a = d[j]
b = N - i
for i in range(1, N + 2):
	print((comb(N + 1, i) - comb(a + b, i - 1)) % MOD)


n = int(input())
a = list(map(int, input().split()))
b = [0] * (n + 1)
for i in range(n + 1):
	if b[a[i]] == 0:
		b[a[i]] += 1
	else:
		d = a[i]
l = 0
r = 0
c = 0
for i in range(n + 1):
	if a[i] != d and c == 0:
		l += 1
	elif a[i] != d and c == 2:
		r += 1
	elif a[i] == d:
		c += 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 = 100011
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 i in range(1, n + 2):
	print((cmb(n + 1, i, mod) - cmb(r + l, i - 1, mod)) % mod)


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)


import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce

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

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

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

def LIST():
	return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
n = INT()
a = LIST()
check = [0] * (n + 1)
kaburi = 0
idx1 = 0
idx2 = 0
mod = 10 ** 9 + 7
N = 10 ** 6
factorial = [1]
for i in range(1, N):
	factorial.append(factorial[i - 1] * i % mod)

def power(x, y):
	if y == 0:
		return 1
	elif y == 1:
		return x % mod
	elif y % 2 == 0:
		return power(x, int(y / 2)) ** 2 % mod
	else:
		return power(x, int((y - 1) / 2)) ** 2 * x % mod

def C(n, r):
	return factorial[n] * x_inv[r] % mod * x_inv[n - r] % mod
x_inv = [0] * N
x_inv[-1] = power(factorial[-1], mod - 2)
for i in range(N - 2, -1, -1):
	x_inv[i] = x_inv[i + 1] * (i + 1) % mod
for i in range(n + 1):
	if check[a[i]]:
		kaburi = a[i]
		idx1 = check[a[i]]
		idx2 = i + 1
		break
	check[a[i]] = i + 1
l = idx1 - 1
r = n - idx2 + 1
idx1 -= 1
idx2 -= 1
thre = n - (idx2 - idx1) + 2
for k in range(1, n + 2):
	if k >= thre:
		print(C(n + 1, k) % mod)
	else:
		print((C(n + 1, k) - C(r + l, k - 1)) % mod)


def main():
	from collections import Counter as ct
	fact = [1]
	mod = 10 ** 9 + 7
	n = int(input())
	a = list(map(int, input().split()))
	for i in range(1, n + 2):
		fact.append(fact[-1] * i % mod)

	def inv_n(n, mod=10 ** 9 + 7):
		return pow(n, mod - 2, mod)

	def nCr(n, r, mod=10 ** 9 + 7):
		return inv_n(fact[n - r] * fact[r] % mod, mod) * fact[n] % mod
	c = ct(a).most_common()[0][0]
	(p, q) = (-1, -1)
	for i in range(n + 1):
		if a[i] == c:
			if p == -1:
				p = i
			else:
				q = i
	x = p + n - q
	for k in range(1, n + 2):
		ans = 0
		if k - 2 >= 0:
			ans += nCr(n - 1, k - 2)
		if k <= n - 1:
			ans += nCr(n - 1, k)
		if k <= n:
			ans += 2 * nCr(n - 1, k - 1)
		if k - 1 <= x:
			ans -= nCr(x, k - 1)
		print((ans + mod) % mod)
main()


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)


def main():
	(n, *a) = map(int, open(0).read().split())
	dbl = sum(a) - n * (n + 1) // 2
	(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)
main()


def power(x, n):
	y = 1
	while n > 0:
		if n % 2 == 0:
			x = x * x % (10 ** 9 + 7)
			n = n // 2
		else:
			y = y * x % (10 ** 9 + 7)
			n = n - 1
	return y
MOD = 10 ** 9 + 7
n = int(input())
a = list(map(int, input().split()))
fact = [1] * (n + 2)
inv = [1] * (n + 3)
for i in range(1, n + 2):
	fact[i] = i * fact[i - 1] % MOD
	inv[i] = power(fact[i], MOD - 2) % MOD

def nCm(n, m):
	global fact
	global inv
	return fact[n] * inv[m] % MOD * inv[n - m] % MOD
saw = [-1] * n
left = 0
right = 0
for i in range(n):
	if saw[a[i] - 1] == -1:
		saw[a[i] - 1] = i
	else:
		(left, right) = (saw[a[i] - 1], n - i)
		break
for i in range(1, n + 2):
	if i == 1:
		print(n)
	elif left + right >= i - 1:
		print((nCm(n + 1, i) - nCm(left + right, i - 1)) % MOD)
	else:
		print(nCm(n + 1, i))


import sys

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

def mapint():
	return map(int, input().split())
sys.setrecursionlimit(10 ** 9)
N = int(input())
As = list(mapint())
s = set()
for i in range(N + 1):
	a = As[i]
	if a in s:
		r = N - i
		l = As.index(a)
		break
	s.add(a)
mod = 10 ** 9 + 7
rest = l + r
pos = {}
neg = {}
pos[0] = 1
neg[0] = 1
c = 1
for i in range(1, 10 ** 5 + 5):
	c *= i
	c %= mod
	pos[i] = c
	neg[i] = pow(c, mod - 2, mod)
for i in range(1, N + 2):
	All = pos[N + 1] * neg[i] * neg[N + 1 - i] % mod
	if rest - i + 1 >= 0:
		kaburi = pos[rest] * neg[i - 1] * neg[rest - i + 1] % mod
	else:
		kaburi = 0
	print((All - kaburi) % mod)


n = int(input())
nums = list(map(int, input().split()))
max_len = n + 5
mod = 10 ** 9 + 7
modinv_table = [-1] * (max_len + 1)
modinv_table[0] = None
factori_table = [1] * (max_len + 1)
factori_inv_table = [1] * (max_len + 1)
for i in range(1, max_len + 1):
	factori_table[i] = factori_table[i - 1] * i % mod
modinv_table[1] = 1
for i in range(2, max_len + 1):
	modinv_table[i] = -modinv_table[mod % i] * (mod // i) % mod
	factori_inv_table[i] = factori_inv_table[i - 1] * modinv_table[i] % mod

def binomial_coefficients(n, k):
	if not 0 <= k <= n:
		return None
	return factori_table[n] * factori_inv_table[k] * factori_inv_table[n - k] % mod
appearance = [-1] * (n + 1)
for (idx, num) in enumerate(nums):
	if appearance[num] == -1:
		appearance[num] = idx
	else:
		dup = [appearance[num], idx]
		break
j = n + 1 - (dup[1] - dup[0] + 1)
for k in range(1, n + 1 + 1):
	if k - 1 > j:
		print(binomial_coefficients(n + 1, k))
	else:
		print((binomial_coefficients(n + 1, k) - binomial_coefficients(j, k - 1)) % mod)


MOD = 10 ** 9 + 7
MAXN = 100005
factorial = [1]
for i in range(1, MAXN + 1):
	factorial.append(factorial[-1] * i % MOD)
inv_factorial = [-1] * (MAXN + 1)
inv_factorial[-1] = pow(factorial[-1], MOD - 2, MOD)
for i in reversed(range(MAXN)):
	inv_factorial[i] = inv_factorial[i + 1] * (i + 1) % MOD

def fact(n):
	return factorial[n]

def nck(n, k):
	if k > n or k < 0:
		return 0
	else:
		return factorial[n] * inv_factorial[n - k] * inv_factorial[k] % MOD

def main():
	n = int(input())
	a = list(map(int, input().split()))
	dic = {i: [] for i in range(1, n + 1)}
	for i in range(n + 1):
		dic[a[i]].append(i)
		if len(dic[a[i]]) >= 2:
			(l, r) = (dic[a[i]][0], dic[a[i]][1])
			break
	r = n - r
	print(n)
	for i in range(2, n + 2):
		print((nck(n + 1, i) - nck(l + r, i - 1) + MOD) % MOD)

def __starting_point():
	main()
__starting_point()


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 ** 5 + 5
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 = list(map(int, input().split()))
a = sum(A) - n * (n + 1) // 2
B = []
for i in range(n + 1):
	if A[i] == a:
		B.append(i)
for k in range(1, n + 2):
	print((cmb(n - 1, k, mod) + 2 * cmb(n - 1, k - 1, mod) - cmb(n - B[1] + B[0], k - 1, mod) + cmb(n - 1, k - 2, mod)) % mod)


n = int(input())
a = list(map(int, input().split()))
mod = pow(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
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)
f = [-1] * (n + 1)
(l, r) = (0, 0)
for i in range(n + 1):
	ai = a[i]
	if f[ai] == -1:
		f[ai] = i
	else:
		l = f[ai]
		r = n - i
		break
for k in range(1, n + 2):
	a = cmb(n + 1, k, mod)
	if l + r >= k - 1:
		a -= cmb(l + r, k - 1, mod)
	print(a % mod)


n = int(input())
a = list(map(int, input().split()))
M = 10 ** 9 + 7
res = [-1] * (n + 1)
for i in range(n + 1):
	if res[a[i]] == -1:
		res[a[i]] = i
	else:
		d = a[i]
		(l, r) = (res[d], n - 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)
for i in range(1, n + 2):
	print((cmb(n + 1, i, mod) - cmb(l + r, i - 1, mod)) % 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)))


n = int(input())
a = list(map(int, input().split()))
b = [-1] * (n + 1)
MOD = 10 ** 9 + 7
factorials = [1]
current = 1
for i in range(1, n + 2):
	current = current * i % MOD
	factorials.append(current)
inverses = []
for i in range(n + 2):
	inverses.append(pow(factorials[i], MOD - 2, MOD))
for i in range(n + 1):
	if b[a[i]] != -1:
		l = b[a[i]]
		r = i
		break
	b[a[i]] = i
for i in range(1, n + 2):
	ans = factorials[n + 1] * inverses[i] * inverses[n + 1 - i] % MOD
	rem = n - r + l
	if rem >= i - 1:
		ans = (ans - factorials[rem] * inverses[i - 1] * inverses[rem - (i - 1)]) % MOD
	print(ans)


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)


N = int(input())
A = list(map(int, input().split()))
p = [-1] * N
x = 0
for i in range(N):
	if p[A[i] - 1] == -1:
		p[A[i] - 1] = i
	else:
		x = p[A[i] - 1] + N - i
		break
m = 10 ** 9 + 7
print(N)
(a, b) = (N + 1, 1)

def sub(a, b):
	return (a - b) % m

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

def div(a, b):
	return mul(a, pow(b, m - 2, m))
for k in range(2, N + 2):
	a = div(a * (N + 2 - k), k)
	b = div(b * (x + 2 - k), k - 1)
	print(sub(a, b))


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()


N = int(input())
A = list(map(int, input().split()))
from collections import Counter
two = 0
a = Counter(A)
for (k, v) in a.items():
	if v == 2:
		two = k
LR = []
for i in range(N + 1):
	if A[i] == two:
		LR.append(i)
L = LR[0]
R = LR[1]
mod = 10 ** 9 + 7
P = [1 for i in range(10 ** 6 + 1)]
for i in range(10 ** 6):
	P[i + 1] = P[i] * (i + 1) % mod
L += 1
R += 1

def comb(a, b):
	if a >= b:
		return P[a] * pow(P[a - b], mod - 2, mod) * pow(P[b], mod - 2, mod) % mod
	else:
		return 0
for i in range(1, N + 2):
	print((comb(N + 1, i) - comb(N + L - R, i - 1)) % mod)


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

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)
for i in range(n + 1):
	if a[i] not in d:
		d[a[i]] = i
	else:
		idx1 = d[a[i]]
		idx2 = i
		break
for i in range(1, n + 2):
	ans = cmb(n + 1, i, mod)
	if n - idx2 + idx1 < i - 1:
		print(ans)
	else:
		ans = (ans - cmb(n - idx2 + idx1, i - 1, mod) + mod) % mod
		print(ans % mod)


import sys
input = sys.stdin.readline

def solve():
	N = int(input())
	d = {i: -1 for i in range(1, N + 1)}
	(*l,) = list(map(int, input().split()))
	MOD = 10 ** 9 + 7
	n = N + 1
	fac = [1] * (n + 1)
	rev = [1] * (n + 1)
	for i in range(1, n + 1):
		fac[i] = i * fac[i - 1] % MOD
		rev[i] = pow(fac[i], MOD - 2, MOD)
	comb = lambda a, b: fac[a] * rev[a - b] * rev[b] % MOD if a >= b else 0
	for (i, j) in enumerate(l):
		if d[j] != -1:
			break
		d[j] = i
	v = d[j] + N - i
	for i in range(1, N + 2):
		print((comb(N + 1, i) - comb(v, i - 1)) % MOD)

def __starting_point():
	solve()
__starting_point()


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

def nCk(n, k):
	if k < 0 or n < k:
		return 0
	else:
		return fact[n] * invfact[k] * invfact[n - k] % MOD
for (i, num) in enumerate(alst):
	if num_pos[num - 1] == -1:
		num_pos[num - 1] = i
	else:
		bef = num_pos[num - 1]
		aft = n - i
for i in range(1, n + 2):
	ans = nCk(n + 1, i) - nCk(bef + aft, i - 1)
	ans %= MOD
	print(ans)


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 sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
p = 10 ** 9 + 7
n = int(input())
a = list(map(int, input().split()))
count = [0] * n
for i in range(n + 1):
	count[a[i] - 1] += 1
	if count[a[i] - 1] == 2:
		right = i
		left = a.index(a[i])
		break

def nCr_mod_p(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
N = 10 ** 5
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)
for i in range(1, n + 2):
	ans = nCr_mod_p(n + 1, i, p) - nCr_mod_p(n - right + left, i - 1, p)
	print(ans % p)


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 = list(map(int, input().split()))
mod = pow(10, 9) + 7
num = [-1] * (n + 1)
for i in range(n + 1):
	if num[a[i]] == -1:
		num[a[i]] = i
	else:
		(samei, samej) = (num[a[i]], i)
		break
x = n + samei - samej
same = 1
comb = n + 1
print(comb - 1)
for i in range(2, n + 2):
	comb = comb * (n - i + 2) * pow(i, mod - 2, mod) % mod
	if i - 1 <= x:
		same = same * (x - i + 2) * pow(i - 1, mod - 2, mod) % mod
	else:
		same = 0
	print((comb - same) % mod)


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)


def comb(k, r):
	if k < 0 or r < 0 or r > k:
		return 0
	elif k == 0 or r == 0:
		return 1
	else:
		return X[k] * Y[r] * Y[k - r]

def power_func(a, b, p):
	if b == 0:
		return 1
	if b % 2 == 0:
		d = power_func(a, b // 2, p)
		return d * d % p
	if b % 2 == 1:
		return a * power_func(a, b - 1, p) % p
n = int(input())
a = list(map(int, input().split()))
p = 10 ** 9 + 7
ans = 0
X = [1]
for i in range(1, n + 2):
	X += [X[-1] * i % p]
Y = [1] * (n + 2)
Y[n + 1] = power_func(X[n + 1], p - 2, p)
for i in range(n, -1, -1):
	Y[i] = Y[i + 1] * (i + 1) % p
check = [0] * n
for i in range(n + 1):
	if check[a[i] - 1] == 1:
		dub = a[i]
	else:
		check[a[i] - 1] = 1
indexes = [i for (i, x) in enumerate(a) if x == dub]
(ind1, ind2) = (indexes[0], indexes[1])
for i in range(1, n + 2):
	ans = comb(n + 1, i)
	if ind1 + n - ind2 + 1 >= i:
		ans -= comb(ind1 + n - ind2, i - 1)
	print(ans % p)


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 ** 5 + 5
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())
n += 1
a = list(map(int, input().split()))
x = y = 0
b = [-1 for i in range(n)]
for i in range(len(a)):
	if b[a[i]] != -1:
		x = b[a[i]]
		y = i
		break
	else:
		b[a[i]] = i
for k in range(1, n + 1):
	print((cmb(n, k, mod) - cmb(n + x - y - 1, k - 1, mod)) % mod)


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
N = 10 ** 6
fact = [1, 1]
factinv = [1, 1]
inv = [0, 1]
for i in range(2, N + 1):
	fact.append(fact[-1] * i % p)
	inv.append(-inv[p % i] * (p // i) % p)
	factinv.append(factinv[-1] * inv[-1] % p)
N = int(input())
A = list(map(int, input().split()))
index = [-1] * N
for (i, a) in enumerate(A):
	if index[a - 1] != -1:
		(dup_first, dup_second) = (index[a - 1], i)
		break
	index[a - 1] = i
mod = 10 ** 9 + 7
n = dup_first
m = N - dup_second
l = n + m
for k in range(1, N + 2):
	if k == 1:
		print(N)
		continue
	ans = (cmb(N + 1, k, mod) - cmb(l, k - 1, mod)) % mod
	print(ans)


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
g1 = [1, 1]
g2 = [1, 1]
inv = [0, 1]
for i in range(2, n + 2):
	g1.append(g1[-1] * i % mod)
	inv.append(-inv[mod % i] * (mod // i) % mod)
	g2.append(g2[-1] * inv[-1] % mod)

def comb(n, r):
	if r < 0 or r > n:
		return 0
	return g1[n] * g2[r] * g2[n - r] % mod
t = sum(a) - n * (n + 1) // 2
m = a.index(t) + a[::-1].index(t)
for k in range(1, n + 2):
	print((comb(n + 1, k) - comb(m, k - 1)) % mod)


(N, MOD) = (10 ** 5 + 1, 10 ** 9 + 7)
(fc, ifc) = ([0] * (N + 1), [0] * (N + 1))

def power(n, a):
	(res, exp) = (1, n)
	while a:
		if a & 1:
			res = res * exp % MOD
		exp = exp * exp % MOD
		a = a >> 1
	return res
fc[0] = 1
for i in range(1, N + 1):
	fc[i] = fc[i - 1] * i % MOD
ifc[N] = power(fc[N], MOD - 2)
for i in range(N - 1, -1, -1):
	ifc[i] = ifc[i + 1] * (i + 1) % MOD

def Comb(n, r):
	if n < 0 or r < 0 or n < r:
		return 0
	return fc[n] * ifc[r] % MOD * ifc[n - r] % MOD
n = int(input())
a = list(map(int, input().split()))
num = [-1] * (n + 1)
l = r = -1
for i in range(len(a)):
	if num[a[i]] != -1:
		(l, r) = (num[a[i]], i)
		break
	num[a[i]] = i
for k in range(1, len(a) + 1):
	ans = Comb(len(a), k) - Comb(l + len(a) - r - 1, k - 1)
	while ans < 0:
		ans += MOD
	print(ans)


n = int(input())
a = [int(j) for j in input().split()]
mod = 10 ** 9 + 7
l = [-1] * (n + 1)
ind = []
for i in range(n + 1):
	if l[a[i]] != -1:
		ind = [l[a[i]], i]
		break
	l[a[i]] = i
U = 2 * 10 ** 5
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
	x = fact[n]
	x *= fact_inv[k]
	x %= MOD
	x *= fact_inv[n - k]
	x %= MOD
	return x
(i, j) = ind
for k in range(1, n + 2):
	if k == 1:
		print(n)
	else:
		print((comb(n + 1, k) - comb(i + n - j, k - 1)) % mod)


n = int(input())
l = list(map(int, input().split()))
mod = 10 ** 9 + 7
c = [-1] * (n + 1)
for (i, j) in enumerate(l, 1):
	if c[j] == -1:
		c[j] = i
	else:
		(i1, i2) = (c[j], i)
		break
fra = [1] * (n + 2)
inv = [1] * (n + 2)
c = 1
t = 1
for i in range(1, n + 2):
	c *= i
	c %= mod
	t *= pow(i, mod - 2, mod)
	t %= mod
	fra[i] = c
	inv[i] = t

def comb(n, r):
	return fra[n] * inv[n - r] * inv[r] % mod
for i in range(1, n + 2):
	t = n - i2 + i1
	if t + 1 < i:
		print(comb(n + 1, i))
	else:
		print((comb(n + 1, i) - comb(t, i - 1)) % mod)


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')


mod = int(1000000000.0) + 7

def power(x, y):
	if y == 0:
		return 1
	elif y == 1:
		return x % mod
	elif y % 2 == 0:
		return power(x, y // 2) ** 2 % mod
	else:
		return power(x, y // 2) ** 2 * x % mod
fact = [1] * int(100000.0 + 2)
for i in range(1, int(100000.0 + 2)):
	fact[i] = i * fact[i - 1] % mod
inv = [1] * int(100000.0 + 2)
inv[int(100000.0 + 1)] = power(fact[int(100000.0 + 1)], mod - 2) % mod
for i in range(int(100000.0), 0, -1):
	inv[i] = inv[i + 1] * (i + 1) % mod

def combination(n, r):
	return fact[n] * inv[r] * inv[n - r] % mod

def main():
	N = int(input())
	A = list(map(int, input().split()))
	idx = [-1] * (N + 1)
	x = 0
	for i in range(N + 1):
		if idx[A[i]] == -1:
			idx[A[i]] = i
		else:
			x = i - idx[A[i]]
	for i in range(1, N + 2):
		ans = combination(N + 1, i)
		if i <= N + 1 - x:
			ans = (ans - combination(N + 1 - (x + 1), i - 1)) % mod
		print(ans)
main()


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 ** 5 + 1
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 = list(map(int, input().split()))
data = [0] * (n + 1)
for i in range(n + 1):
	data[a[i]] += 1
for i in range(1, n + 1):
	if data[i] == 2:
		b = i
		break
l = []
for i in range(n + 1):
	if a[i] == b:
		l.append(i)
c = l[1] - l[0] + 1
for k in range(1, n + 3 - c):
	ans = cmb(n + 1, k, mod) - cmb(n + 1 - c, k - 1, mod)
	print(ans % mod)
for k in range(n + 3 - c, n + 2):
	ans = cmb(n + 1, k, mod)
	print(ans)


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)


class Calc:

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

	def nCr(self, n, r):
		r = min(n - r, r)
		if r < 0:
			return 0
		if r == 0:
			return 1
		if r == 1:
			return n
		return self.fact[n] * self.invs[r] * self.invs[n - r] % self.mod

	def nHr(self, n, r):
		return self.nCr(n - 1 + r, r)

def main():
	MOD = 10 ** 9 + 7
	N = int(input())
	A = map(int, input().split())
	B = [-1] * (N + 1)
	d = None
	for (i, x) in enumerate(A):
		if ~B[x]:
			d = (B[x], i)
			break
		B[x] = i
	calc = Calc(max_value=N + 1, mod=MOD)
	ans = []
	Y = d[1] - 1 - d[0]
	for k in range(1, N + 2):
		ans.append((calc.nCr(N + 1, k) - calc.nCr(N + 1 - 2 - Y, k - 1)) % MOD)
	print(*ans, sep='\n')

def __starting_point():
	main()
__starting_point()


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()


N = int(input())
A = [int(x) for x in input().split()]
se = []
c = sum(A) - N * (N + 1) / 2
for i in range(len(A)):
	if A[i] == c:
		se.append(i)
l = se[0]
r = se[1]
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[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(l + N - r, i - 1)) % mod)


n = int(input())
A = list(map(int, input().split()))
idx = [-1] * (n + 1)
for (i, a) in enumerate(A, 1):
	if idx[a] == -1:
		idx[a] = i
	else:
		r = i
		l = idx[a]
MAX_N = 10 ** 6 + 5
MOD = 10 ** 9 + 7
fac = [0] * MAX_N
fac[0] = 1
for i in range(1, MAX_N):
	fac[i] = i * fac[i - 1] % MOD
fac_inv = [0] * MAX_N
fac_inv[-1] = pow(fac[-1], MOD - 2, MOD)
for i in range(MAX_N - 2, -1, -1):
	fac_inv[i] = fac_inv[i + 1] * (i + 1) % MOD

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


N = int(input())
A = list(map(int, input().split()))
MOD = 10 ** 9 + 7
fact = [1 for _ in range(N + 10)]
invFact = [0 for _ in range(N + 10)]

def modInv(a):
	b = MOD
	u = 1
	v = 0
	while b:
		t = a // b
		a -= t * b
		(a, b) = (b, a)
		u -= t * v
		(u, v) = (v, u)
	u %= MOD
	return u
for i in range(1, N + 10):
	fact[i] = fact[i - 1] * i % MOD
	invFact[i] = modInv(fact[i])
index = [[] for _ in range(N + 1)]
for (i, a) in enumerate(A):
	index[a].append(i)
left = 0
right = 0
for count in index:
	if len(count) == 2:
		left = min(count)
		right = max(count)

def comb(n, r):
	if 0 < r < n:
		return fact[n] * invFact[r] % MOD * invFact[n - r] % MOD
	if r == 0 or r == n:
		return 1
	return 0
les = left + (N - right)
for k in range(1, N + 2):
	r = comb(les, k - 1)
	ans = comb(N + 1, k) - r
	print(ans % MOD)


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)


MOD = 10 ** 9 + 7
table_len = 10 ** 5 + 10
fac = [1, 1]
for i in range(2, table_len):
	fac.append(fac[-1] * i % MOD)
finv = [0] * table_len
finv[-1] = pow(fac[-1], MOD - 2, MOD)
for i in range(table_len - 1, 0, -1):
	finv[i - 1] = finv[i] * i % MOD
N = int(input())
As = map(int, input().split())
last = [-1] * (N + 1)
for (i, A) in enumerate(As):
	if last[A] == -1:
		last[A] = i
	else:
		l = last[A]
		r = N - i
		break
for k in range(1, N + 2):
	ans = fac[N + 1] * finv[k] % MOD * finv[N + 1 - k] % MOD
	if l + r >= k - 1:
		ans -= fac[l + r] * finv[k - 1] % MOD * finv[l + r - k + 1] % MOD
		ans %= MOD
	print(ans)


m = 10 ** 9 + 7
n = int(input())
inv = [0] * (n + 3)
inv[1] = 1
for i in range(2, n + 3):
	inv[i] = m // i * (m - inv[m % i]) % m
a = list(map(int, input().split()))
w = sum(a) - n * (n + 1) // 2
q = 0
t = -1
for i in range(n + 1):
	if a[i] == w:
		q += t * i
		t = 1
q += 1
x = (n + 1) % m
y = 1
for k in range(1, n + 2):
	print((x - y) % m)
	x = x * (n + 1 - k) * inv[k + 1] % m
	y = y * (n + 2 - q - k) * inv[k] % m


import sys
sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def MI():
	return map(int, sys.stdin.readline().split())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def com(com_n, com_r):
	if com_n < com_r:
		return 0
	return fac[com_n] * inv[com_r] * inv[com_n - com_r] % md
md = 10 ** 9 + 7
n_max = 10 ** 5 + 3
fac = [1]
inv = [1] * (n_max + 1)
k_fac_inv = 1
for i in range(1, n_max + 1):
	k_fac_inv = k_fac_inv * i % md
	fac.append(k_fac_inv)
k_fac_inv = pow(k_fac_inv, md - 2, md)
for i in range(n_max, 1, -1):
	inv[i] = k_fac_inv
	k_fac_inv = k_fac_inv * i % md

def main():
	n = int(input())
	aa = LI()
	pos = [-1] * (n + 3)
	for (i, a) in enumerate(aa):
		if pos[a] == -1:
			pos[a] = i
		else:
			lr = n - i + pos[a]
	for k in range(1, n + 2):
		ans = com(n + 1, k) - com(lr, k - 1)
		print(ans % md)
main()


from collections import Counter

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())
C = Counter(A)
t = C.most_common()[0][0]
left = A.index(t)
right = A.index(t, left + 1)
mc = ModComb(10 ** 5 + 5, mod=mod)
m = left + N - right
for k in range(1, N + 2):
	print((mc.nCk(N + 1, k) - mc.nCk(m, k - 1)) % mod)


mod = 10 ** 9 + 7

def extGCD(a, b):
	if b == 0:
		return (a, 1, 0)
	(g, y, x) = extGCD(b, a % b)
	y -= a // b * x
	return (g, x, y)

def moddiv(a, b):
	(_, inv, _) = extGCD(b, mod)
	return a * inv % mod
N = 10 ** 5 + 10
fact = [0] * N
fact[0] = 1
for i in range(1, N):
	fact[i] = fact[i - 1] * i % mod

def comb(a, b):
	return moddiv(moddiv(fact[a], fact[a - b]), fact[b])
n = int(input())
a = list(map(int, input().split()))
searched = set()
for (dup, x) in enumerate(a):
	if x in searched:
		break
	else:
		searched.add(x)
first = a.index(a[dup])
for k in range(1, n + 2):
	ans = comb(n + 1, k)
	if k - 1 <= n - dup + first:
		ans -= comb(n - dup + first, k - 1)
	print(ans % mod)


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)


n = int(input())
a = list(map(int, input().split()))
dup = sum(a) - n * (n + 1) // 2
d1 = a.index(dup)
d2 = a.index(dup, d1 + 1)
N = n + 1
Ndup = d1 + n - d2
MOD = 10 ** 9 + 7
inv = [0 for i in range(N + 1)]
inv[1] = 1
for i in range(2, N + 1):
	inv[i] = -(MOD // i) * inv[MOD % i] % MOD
C = N
Cdup = 1
print(N - 1)
for k in range(2, N + 1):
	C = C * (N - k + 1) * inv[k] % MOD
	Cdup = Cdup * (Ndup - k + 2) * inv[k - 1] % MOD
	print((C - Cdup) % MOD)


N = int(input())
A = list(map(int, input().split()))
dup = sum(A) - N * (N + 1) // 2
idx = []
for i in range(len(A)):
	if A[i] == dup:
		idx.append(i)
countXZ = N - idx[1] + idx[0]
mod = 10 ** 9 + 7
NMAX = 10 ** 5 + 10
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]
for i in range(2, NMAX + 1):
	g1.append(g1[-1] * i % mod)
	inverse.append(-inverse[mod % i] * (mod // i) % mod)
	g2.append(g2[-1] * inverse[-1] % mod)

def cmb(n, r, m=mod):
	if r < 0 or r > n:
		return 0
	r = min(r, n - r)
	return g1[n] * g2[r] * g2[n - r] % m
print(N)
for k in range(2, N + 1):
	wk = cmb(N - 1, k)
	wk += cmb(N - 1, k - 2)
	wk += cmb(N - 1, k - 1) * 2
	wk -= cmb(countXZ, k - 1)
	print(wk % mod)
print(1)


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')


import sys
input = sys.stdin.readline
M = 10 ** 9 + 7
n = int(input())
a = list(map(int, input().split()))
assert len(a) == n + 1
b = [None] * (n + 1)
(d1, d2) = (-1, -1)
for i in range(n + 1):
	if b[a[i]] is None:
		b[a[i]] = i
	else:
		d1 = b[a[i]]
		d2 = i
		break
assert d1 >= 0 and d2 >= 0 and (a[d1] == a[d2])
(a, b, ik) = (n + 1, 1, 1)
for k in range(1, n + 2):
	ans = (a - b) % M
	print(ans)
	b = b * (n + 1 - d2 + d1 - k) * ik % M
	ik = pow(k + 1, M - 2, M)
	a = a * (n + 1 - k) * ik % M


mod = 10 ** 9 + 7
n = int(input())
a = list(map(int, input().split()))
c = [0] * n
for i in a:
	c[i - 1] += 1
ind = c.index(2)
x = []
for i in range(n + 1):
	if a[i] == ind + 1:
		x.append(i)
m = n + x[0] - x[1]
ans = 1
anss = 1
for k in range(1, n + 2):
	ans = ans * (n - k + 2) % mod
	ans = ans * pow(k, mod - 2, mod) % mod
	if k == 1:
		print(n)
		continue
	anss = anss * (m - k + 2) % mod
	anss = anss * pow(k - 1, mod - 2, mod) % mod
	if k - 1 > m:
		print(ans)
		continue
	print((ans - anss) % mod)


import sys
sys.setrecursionlimit(10 ** 7)

def I():
	return int(sys.stdin.readline().rstrip())

def MI():
	return map(int, sys.stdin.readline().rstrip().split())

def LI():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def LI2():
	return list(map(int, sys.stdin.readline().rstrip()))

def S():
	return sys.stdin.readline().rstrip()

def LS():
	return list(sys.stdin.readline().rstrip().split())

def LS2():
	return list(sys.stdin.readline().rstrip())
N = I()
A = [0] + LI()
mod = 10 ** 9 + 7
count = [0] * (N + 1)
for i in range(1, N + 2):
	if count[A[i]] != 0:
		a = count[A[i]]
		b = i
	else:
		count[A[i]] = i
kaijou = [1]
for i in range(1, N + 2):
	kaijou.append(kaijou[-1] * i % mod)

def nCr(n, r):
	if n < r:
		return 0
	return kaijou[n] * pow(kaijou[r], mod - 2, mod) * pow(kaijou[n - r], mod - 2, mod) % mod
for k in range(1, N + 2):
	print((nCr(N + 1, k) - nCr(N + a - b, k - 1)) % mod)


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)


import math
MOD = 10 ** 9 + 7

def xgcd(a, b):
	(x0, y0, x1, y1) = (1, 0, 0, 1)
	while b != 0:
		(q, a, b) = (a // b, b, a % b)
		(x0, x1) = (x1, x0 - q * x1)
		(y0, y1) = (y1, y0 - q * y1)
	return (a, x0, y0)

def modinv(a):
	(g, x, y) = xgcd(a, MOD)
	return x
fact = [1] * 100100
for i in range(1, 100100):
	fact[i] = fact[i - 1] * i % MOD

def comb(n, r):
	if n < r or r < 0:
		return 0
	else:
		return fact[n] * modinv(fact[n - r]) * modinv(fact[r]) % MOD
n = int(input())
a = list(map(int, input().split()))
x = sum(a) - n * (n + 1) // 2
l = 0
while a[l] != x:
	l += 1
r = 0
while a[n - r] != x:
	r += 1
c = n + 1 - l - r - 2
for k in range(1, n + 2):
	ans = comb(n + 1, k) - comb(l + r, k - 1)
	if ans < 0:
		ans += MOD
	print(ans)


MOD = 10 ** 9 + 7
MOD_t_MAX = 10 ** 5 + 10
fac = [None] * MOD_t_MAX
finv = [None] * MOD_t_MAX
inv = [None] * MOD_t_MAX

def MOD_COM_init():
	fac[0] = fac[1] = 1
	finv[0] = finv[1] = 1
	inv[1] = 1
	for i in range(2, MOD_t_MAX):
		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 MOD_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

def main():
	n = int(input())
	a = list(map(int, input().split()))
	p = [-1] * (n + 1)
	(l, r) = (-1, -1)
	for (i, v) in enumerate(a):
		if p[v] == -1:
			p[v] = i
		else:
			l = p[v]
			r = i
			break
	MOD_COM_init()
	for i in range(1, n + 2):
		if i == 1:
			print(n)
		else:
			tmp = MOD_COM(n + 1, i)
			tmp -= MOD_COM(l + (n + 1 - r - 1), i - 1)
			while tmp < 0:
				tmp += MOD
			print(tmp)

def __starting_point():
	main()
__starting_point()


import sys
input = sys.stdin.readline
n = int(input())
a_list = list(map(int, input().split()))
num = [[] for i in range(n)]
for i in range(n + 1):
	num[a_list[i] - 1].append(i)
for i in num:
	if len(i) == 2:
		x = i[0]
		y = n - i[1]
INF = 10 ** 9 + 7
z = x + y

def modinv(a, m):
	b = m
	(x, lastx) = (0, 1)
	(y, lasty) = (1, 0)
	while not b == 0:
		q = a // b
		(a, b) = (b, a % b)
		(x, lastx) = (lastx - q * x, x)
		(y, lasty) = (lasty - q * y, y)
	return lastx % m
a = n + 1
b = 1
for i in range(n + 1):
	print((a - b) % INF)
	a = a * (n - i) * modinv(i + 2, INF) % INF
	b = b * (z - i) * modinv(i + 1, INF) % INF


(n, *a) = map(int, open(0).read().split())
left = 0
right = 0
val = 0
seen = [False] * (n + 1)
for i in range(n + 1):
	if seen[a[i]]:
		right = i
		val = a[i]
		break
	seen[a[i]] = True
for i in range(n):
	if a[i] == val:
		left = i
		break
mod = 10 ** 9 + 7
fac = [1] * (n + 5)
for i in range(1, n + 3):
	fac[i] = fac[i - 1] * i % mod

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

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


import sys
input = sys.stdin.readline
from collections import *
MAX = 10 ** 5 + 100
MOD = 10 ** 9 + 7
fact = [0] * MAX
inv = [0] * MAX
finv = [0] * MAX
fact[0] = 1
fact[1] = 1
finv[0] = 1
finv[1] = 1
inv[1] = 1
for i in range(2, MAX):
	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 C(n, r):
	if n < r:
		return 0
	if n < 0 or r < 0:
		return 0
	return fact[n] * (finv[r] * finv[n - r] % MOD) % MOD
n = int(input())
a = list(map(int, input().split()))
idx = defaultdict(list)
for i in range(n + 1):
	idx[a[i]].append(i)
for i in range(1, n + 1):
	if len(idx[i]) == 2:
		f = idx[i][0]
		s = idx[i][1]
		break
for k in range(1, n + 2):
	print((C(n - 1, k) + 2 * C(n - 1, k - 1) - C(n + f - s, k - 1) + C(n - 1, k - 2)) % MOD)


n = int(input())
a = list(map(int, input().split()))
MOD = 10 ** 9 + 7
d = {}
(L, R) = (-1, -1)
for i in range(n + 1):
	if a[i] in d:
		L = d[a[i]] + 1
		R = i + 1
		break
	else:
		d[a[i]] = i
MOD = 10 ** 9 + 7
M = 100005
fact = [0] * M
fact[0] = 1
for i in range(1, M):
	fact[i] = fact[i - 1] * i
	fact[i] %= MOD
rfact = [0] * M
rfact[M - 1] = pow(fact[M - 1], MOD - 2, MOD)
for i in range(M - 2, -1, -1):
	rfact[i] = rfact[i + 1] * (i + 1)
	rfact[i] %= MOD

def comb(x, y):
	if x < 0 or y < 0 or x < y:
		return 0
	return fact[x] * rfact[y] * rfact[x - y] % MOD
for i in range(1, n + 2):
	print((comb(n + 1, i) - comb(n + 1 - R + L - 1, i - 1)) % MOD)


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

def resolve():
	n = int(input())
	A = list(map(int, input().split()))
	D = Counter(A)
	for (k, v) in list(D.items()):
		if v == 2:
			db = k
			break
	flg = 1
	(right, left) = (0, 0)
	for i in range(n + 1):
		if flg and A[i] == db:
			left = i
			flg ^= 1
		elif A[i] == db:
			right = i
			break
	length = n - (right - left)

	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
	fact = [1, 1]
	factinv = [1, 1]
	inv = [0, 1]
	for i in range(2, n + 2):
		fact.append(fact[-1] * i % mod)
		inv.append(-inv[mod % i] * (mod // i) % mod)
		factinv.append(factinv[-1] * inv[-1] % mod)

	def cmb_mod(n, r, mod):
		(x, y) = (1, 1)
		for i in range(r):
			x = x * (n - i) % mod
			y = y * (i + 1) % mod
		return x * pow(y, mod - 2, mod) % mod
	for i in range(1, n + 2):
		res = cmb(n + 1, i, mod) - cmb(length, i - 1, mod)
		print(res % mod)

def __starting_point():
	resolve()
__starting_point()


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
MAX = 10 ** 5 + 1000
g1 = [1, 1]
g2 = [1, 1]
for i in range(2, MAX + 1):
	num_1 = g1[-1] * i % mod
	g1.append(num_1)
	g2.append(pow(num_1, mod - 2, mod))

def cmb(n, r, MOD):
	return g1[n] * g2[r] * g2[n - r] % MOD
n = int(input())
a = list(map(int, input().split()))
data = [0] * (n + 1)
for i in range(n + 1):
	data[a[i]] += 1
for i in range(1, n + 1):
	if data[i] == 2:
		b = i
		break
l = []
for i in range(n + 1):
	if a[i] == b:
		l.append(i)
c = l[1] - l[0] + 1
for k in range(1, n + 3 - c):
	ans = cmb(n + 1, k, mod) - cmb(n + 1 - c, k - 1, mod)
	print(ans % mod)
for k in range(n + 3 - c, n + 2):
	ans = cmb(n + 1, k, mod)
	print(ans)


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)


mod = 10 ** 9 + 7
n = int(input())
a = list(map(int, input().split()))
d = sum(a) - sum(range(n + 1))
i1 = a.index(d)
i2 = i1 + 1 + a[i1 + 1:].index(d)
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)
h1 = [1, 1]
h2 = [1, 1]
iinverse = [0, 1]
for i in range(2, n - i2 + i1 + 1):
	h1.append(h1[-1] * i % mod)
	iinverse.append(-iinverse[mod % i] * (mod // i) % mod)
	h2.append(h2[-1] * iinverse[-1] % mod)
for i in range(n + 1):
	print((g1[n + 1] * g2[i + 1] * g2[n - i] % mod - (h1[n - i2 + i1] * h2[i] * h2[n - i2 + i1 - i] if n - i2 + i1 >= i else 0) % 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()


n = int(input())
a = list(map(int, input().split()))
l = [None] * (n + 1)
for i in range(n + 1):
	if l[a[i]] == None:
		l[a[i]] = i
	else:
		p = l[a[i]] + n - i
		break
pr = 10 ** 9 + 7
print(n)
MAX_NUM = 10 ** 5 + 2
fac = [0 for _ in range(MAX_NUM)]
finv = [0 for _ in range(MAX_NUM)]
inv = [0 for _ in range(MAX_NUM)]
fac[0] = fac[1] = 1
finv[0] = finv[1] = 1
inv[1] = 1
for i in range(2, MAX_NUM):
	fac[i] = fac[i - 1] * i % pr
	inv[i] = pr - inv[pr % i] * (pr // i) % pr
	finv[i] = finv[i - 1] * inv[i] % pr

def c(n, k):
	if n < k:
		return 0
	if n < 0 or k < 0:
		return 0
	return fac[n] * (finv[k] * finv[n - k] % pr) % pr
for i in range(2, n + 1):
	t = c(n + 1, i)
	if p >= i - 1:
		t -= c(p, i - 1)
	print(t % pr)
print(1)


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()


from collections import Counter

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, *A) = map(int, open(0).read().split())
Cnt = Counter(A)
for i in range(1, N + 1):
	if Cnt[i] == 2:
		p = i
		break
a = A.index(p)
b = A[::-1].index(p)
for i in range(1, N + 2):
	print((cmb(N + 1, i, mod) - cmb(a + b, i - 1, mod)) % mod)


MOD = 1000000000 + 7
n = int(input())
a = list(map(int, input().split()))
count = [0] * n
for (i, ai) in enumerate(a, 1):
	count[ai - 1] += 1
	if count[ai - 1] == 2:
		common = a.index(ai) + (n + 1 - i)
		break
fac = [1] * (n + 2)
fac_inv = [0] * (n + 2)
for i in range(n + 1):
	fac[i + 1] = fac[i] * (i + 1) % MOD
fac_inv[-1] = pow(fac[-1], MOD - 2, MOD)
for i in range(n + 1, 0, -1):
	fac_inv[i - 1] = fac_inv[i] * i % MOD
for i in range(1, n + 2):
	ans = fac[n + 1] * (fac_inv[i] * fac_inv[n + 1 - i]) % MOD % MOD
	if common >= i - 1:
		ans -= fac[common] * (fac_inv[i - 1] * fac_inv[common - (i - 1)]) % MOD % MOD
	print(ans % MOD)


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()


n = int(input())
a = list(map(int, input().split()))
dic = {}
dic2 = {}
for i in range(n + 1):
	dic[a[i]] = 0
	dic2[a[i]] = []
f = 0
s = 0
for i in range(n + 1):
	dic[a[i]] += 1
	dic2[a[i]].append(i)
	if dic[a[i]] == 2:
		f = dic2[a[i]][0]
		s = 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
N = n + 1
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):
	if k == 1:
		print(n)
	elif k > f + n - s + 1:
		print(cmb(n + 1, k, mod))
	elif cmb(n + 1, k, mod) - cmb(f + n - s, k - 1, mod) >= 0:
		print(cmb(n + 1, k, mod) - cmb(f + n - s, k - 1, mod))
	else:
		print(cmb(n + 1, k, mod) - cmb(f + n - s, k - 1, mod) + mod)


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)


N = int(input())
A = list(map(int, input().split()))
MOD = 10 ** 9 + 7
from collections import Counter
ctr = Counter(A)
d = ctr.most_common(1)[0][0]
x = A.index(d)
y = x + 1 + A[x + 1:].index(d)
f = x + N - y
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 i in range(1, N + 2):
	ans.append((comb(N + 1, i) - comb(f, i - 1)) % MOD)
print(*ans, sep='\n')


def Pow(i, n):
	if n == 0:
		return 1
	else:
		ans = Pow(i * i % mod, n // 2)
		if n % 2 == 1:
			ans *= i
			ans %= mod
		return ans
N = int(input())
A = [int(i) for i in input().split()]
mod = 7 + 10 ** 9
num = [-1 for i in range(N)]
for (i, a) in enumerate(A):
	if num[a - 1] == -1:
		num[a - 1] = i
	else:
		Double = [num[a - 1], i]
Nfact = [1]
for i in range(1, N + 2):
	Nfact.append(Nfact[i - 1] * i % mod)
NfactRev = [Pow(Nfact[N + 1], mod - 2)]
for i in range(1, N + 1):
	NfactRev.append(NfactRev[i - 1] * (N + 2 - i) % mod)
NfactRev.append(1)
NfactRev.reverse()
doublearray = N + 1 - (Double[1] - Double[0])
for i in range(1, N + 2):
	whole = Nfact[N + 1] * NfactRev[N + 1 - i] * NfactRev[i] % mod
	if i <= doublearray:
		double = Nfact[doublearray - 1] * NfactRev[doublearray - i] * NfactRev[i - 1] % mod
	else:
		double = 0
	print((whole - double) % mod)


MOD = 10 ** 9 + 7
p = 100009
fact = [0] * p
fact[0] = 1
for i in range(1, p):
	fact[i] = fact[i - 1] * i % MOD

def MI(a, MOD):
	return pow(a, MOD - 2, MOD)

def nck(n, k, MOD):
	if k < 0:
		return 0
	if n == k or k == 0:
		return 1
	if n < k:
		return 0
	return fact[n] * MI(fact[k], MOD) % MOD * MI(fact[n - k], MOD) % MOD % MOD
n = int(input())
l = [int(i) for i in input().split()]
from collections import Counter
c = Counter(l)
for i in c:
	if c[i] >= 2:
		ans = i
		break
ind1 = -1
ind2 = -1
for i in range(n + 1):
	if l[i] == ans:
		if ind1 == -1:
			ind1 = i
		else:
			ind2 = i
MOD = 10 ** 9 + 7
for i in range(1, n + 2):
	a = nck(n + 1, i, MOD)
	b = nck(n - (ind2 - ind1), i - 1, MOD)
	print((a - b + MOD) % MOD)


N = int(input())
A = list(map(int, input().split()))
T = [-1] * (N + 1)
for i in range(N + 1):
	if T[A[i]] >= 0:
		P1 = T[A[i]]
		P2 = i
		break
	T[A[i]] = i
Q1 = P1
Q2 = P2 - P1 - 1
Q3 = N - P2
MAXN = N + 1 + 5
p = 10 ** 9 + 7
MOD = p
f = [1]
for i in range(MAXN):
	f.append(f[-1] * (i + 1) % MOD)

def nCr(n, r, mod=MOD):
	return f[n] * pow(f[r], mod - 2, mod) * pow(f[n - r], mod - 2, mod) % mod
for K in range(1, N + 2):
	if K == 1:
		print(N)
		continue
	X = nCr(N + 1, K, p)
	if Q1 + Q3 >= K - 1:
		Y = nCr(Q1 + Q3, K - 1, p)
	else:
		Y = 0
	if X - Y < 0:
		X += p
	print((X - Y) % p)


mod = 10 ** 9 + 7
n = int(input())
a = list(map(int, input().split()))
c = [0] * n
for i in a:
	c[i - 1] += 1
ind = c.index(2)
x = []
for i in range(n + 1):
	if a[i] == ind + 1:
		x.append(i)
m = n + x[0] - x[1]
f = [1]
for i in range(1, n + 2):
	f.append(f[-1] * i % mod)

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


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')


import collections
mod = 10 ** 9 + 7
n = int(input())
a = list(map(int, input().split()))
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
already = [0] * (n + 1)
k = 0
for (key, v) in enumerate(a):
	if already[v]:
		k = already[v] + n - key - 1
		break
	else:
		already[v] = key + 1
for i in range(n + 1):
	if i == n:
		print(1)
		exit()
	ans = comb(n, i) + comb(n, i + 1)
	if i <= k:
		ans -= comb(k, i)
	ans %= mod
	print(ans)


def factorials(M):
	INF = int(1000000000.0 + 7)
	fac = [0] * (M + 1)
	finv = [0] * (M + 1)
	inv = [0] * (M + 1)
	fac[0] = fac[1] = 1
	finv[0] = finv[1] = 1
	inv[1] = 1
	for i in range(2, M + 1):
		fac[i] = fac[i - 1] * i % INF
		inv[i] = INF - inv[INF % i] * (INF // i) % INF
		finv[i] = finv[i - 1] * inv[i] % INF
	return (fac, finv)

def nCr(n, r):
	INF = int(1000000000.0 + 7)
	if n < r or r < 0 or n < 0:
		return 0
	return fac[n] * (finv[r] * finv[n - r] % INF) % INF
N = int(input())
(fac, finv) = factorials(N + 1)
A = list(map(int, input().split()))
INF = int(1000000000.0 + 7)
d = [0] * (N + 1)
for i in A:
	d[i] += 1
key = -1
for i in range(1, N + 1):
	if d[i] == 2:
		key = i
(a, b, c) = (0, 0, 0)
t = 0
for i in range(N + 1):
	if key == A[i]:
		t += 1
	elif t == 0:
		a += 1
	elif t == 1:
		b += 1
	elif t == 2:
		c += 1
for i in range(1, N + 2):
	if i == 1:
		print(N)
		continue
	print((nCr(N + 1, i) - nCr(a + c, i - 1)) % INF)


mod = 10 ** 9 + 7
MAX = 10 ** 5 + 1
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
n = int(input())
L = list(map(int, input().split()))
M = []
for i in range(n + 1):
	M.append(L[i])
M.sort()
dou = 1
for i in range(n + 1):
	if M[i] == dou:
		dou += 1
	else:
		dou = M[i]
		break
l = 0
r = 0
cnt = 0
for i in range(n + 1):
	if L[i] == dou and cnt == 0:
		l = i + 1
		cnt += 1
	elif L[i] == dou and cnt == 1:
		r = i + 1
		break
for i in range(1, n + 1):
	print((comb(n + 1, i) - comb(l + n - r, i - 1)) % mod)
print(1)


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 = int(input())
a = list(map(int, input().split()))
search = [-1 for i in range(n)]
(l, r) = (-1, -1)
for (i, x) in enumerate(a):
	if search[x - 1] == -1:
		search[x - 1] = i
	else:
		l = search[x - 1]
		r = i
p = 10 ** 9 + 7
comb1 = [0 for _ in range(n + 1)]
comb1[0] = n + 1
x = n + 1
for i in range(1, n + 1):
	x = x * (n - i + 1) % p
	x = x * pow(i + 1, p - 2, p) % p
	comb1[i] = x
comb2 = [0 for _ in range(n + 1)]
comb2[0] = 1
x = 1
for i in range(1, l + n - r + 1):
	x = x * (n + l - r - i + 1) % p
	x = x * pow(i, p - 2, p) % p
	comb2[i] = x
for i in range(n + 1):
	ans = comb1[i] - comb2[i]
	print(ans % p)


n = int(input())
a = tuple(map(int, input().split()))
occur = [0 for i in range(n + 1)]
MOD = 1000000007
for i in range(n + 1):
	if occur[a[i]] > 0:
		val = n - 1 - i + occur[a[i]]
	else:
		occur[a[i]] = i + 1
inv = [0 if i > 2 else 1 for i in range(n + 2)]
pinv = [0 if i > 2 else 1 for i in range(n + 2)]
perm = [0 if i > 2 else 1 for i in range(n + 2)]
for i in range(2, n + 2):
	inv[i] = -int(MOD / i) * inv[MOD % i] + MOD
	pinv[i] = pinv[i - 1] * inv[i] % MOD
	perm[i] = perm[i - 1] * i % MOD

def C(n, m):
	return perm[m] * pinv[n] % MOD * pinv[m - n] % MOD if n <= m else 0
for i in range(1, n + 2):
	temp = C(i, n + 1) - C(i - 1, val)
	if temp < 0:
		temp += MOD
	print(temp)


n = int(input())
a = list(map(int, input().split()))
dup = sum(a) - n * (n + 1) // 2
d1 = a.index(dup)
d2 = a.index(dup, d1 + 1)
N = n + 1
Ndup = d1 + n - d2
MOD = 10 ** 9 + 7

def power(x, n):
	ans = 1
	while n:
		if n % 2 == 1:
			ans = ans * x % MOD
		x = x * x % MOD
		n //= 2
	return ans
fact = [0 for i in range(N + 1)]
fact[0] = 1
for i in range(1, N + 1):
	fact[i] = fact[i - 1] * i % MOD
inv = [0 for i in range(N + 1)]
inv[N] = power(fact[N], MOD - 2) % MOD
for i in range(N - 1, -1, -1):
	inv[i] = inv[i + 1] * (i + 1) % MOD

def comb(n, r):
	if n < r:
		return 0
	else:
		return fact[n] * inv[n - r] * inv[r] % MOD
for k in range(1, N + 1):
	C = comb(N, k)
	Cdup = comb(Ndup, k - 1)
	print((C - Cdup) % 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


n = int(input())
a = list(map(int, input().split()))
v = [-1 for _ in range(n + 1)]
for i in range(n + 1):
	if v[a[i]] >= 0:
		A = v[a[i]]
		C = n - i
		break
	v[a[i]] = i
MAX_NUM = n + 100
MOD = 10 ** 9 + 7
fac = [0 for _ in range(MAX_NUM)]
finv = [0 for _ in range(MAX_NUM)]
inv = [0 for _ in range(MAX_NUM)]
fac[0] = fac[1] = 1
finv[0] = finv[1] = 1
inv[1] = 1
for i in range(2, MAX_NUM):
	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, k):
	if n < k:
		return 0
	if n < 0 or k < 0:
		return 0
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD
for k in range(1, n + 2):
	print((comb(n + 1, k) - comb(A + C, k - 1)) % MOD)


n = int(input())
(*A,) = map(int, input().split())
cnt = [0] * n
for (i, a) in enumerate(A):
	a -= 1
	if cnt[a] == 0:
		cnt[a] = i + 1
	else:
		N = i - cnt[a]
p = 10 ** 9 + 7
fac = [1] * n
inv = [1] * n
finv = [1] * n
for i in range(2, n):
	fac[i] = fac[i - 1] * i % p
	inv[i] = -inv[p % i] * (p // i) % p
	finv[i] = finv[i - 1] * inv[i] % p

def comb(n, k):
	if n < k:
		return 0
	if n < 0 or k < 0:
		return 0
	return fac[n] * (finv[k] * finv[n - k] % p) % p
for k in range(1, n + 1):
	print((comb(n - 1, k) + comb(n - 1, k - 2) + (comb(n - 1, k - 1) * 2 - comb(n - 1 - N, k - 1))) % p)
print(1)


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 Counter

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 = tuple(map(int, input().split()))
	mod = 10 ** 9 + 7
	X = Counter(A).most_common()[0][0]
	left = A.index(X)
	right = A[::-1].index(X)
	LR = left + right
	comb = Combination(10 ** 5 + 10)
	ans = []
	for i in range(1, N + 2):
		val = comb(N + 1, i) - comb(LR, i - 1)
		val = (val + mod) % mod
		ans.append(val)
	print(*ans, sep='\n')
__starting_point()


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
n = int(input())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7
ct = [0] * n
X = []
for i in range(n + 1):
	ct[a[i] - 1] += 1
for i in range(n):
	if ct[i] == 2:
		x = i + 1
		break
for i in range(n + 1):
	if a[i] == x:
		X.append(i)
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)
for i in range(1, n + 2):
	print((cmb(n + 1, i, mod) - cmb(X[0] + n - X[1], i - 1, mod) + mod) % mod)


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
fac = [1] * (10 ** 5 + 10)
for i in range(len(fac) - 1):
	fac[i + 1] = fac[i] * (i + 1) % MOD

def comb(n, k):
	if k < 0 or k > n:
		return 0
	return fac[n] * pow(fac[n - k], MOD - 2, MOD) * pow(fac[k], MOD - 2, MOD) % MOD
n = int(input())
a = list(map(int, input().split()))
d = [-1] * n
for (i, x) in enumerate(a):
	if d[x - 1] != -1:
		p = d[x - 1]
		q = i
	else:
		d[x - 1] = i
print(n)
for k in range(2, n + 2):
	ans = 0
	ans += comb(n - 1, k - 2)
	ans += comb(n - 1, k - 1) * 2 - comb(p + n - q, k - 1)
	ans += comb(n - 1, k)
	print(ans % 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()


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 = int(input())
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)
li = list(map(int, input().split()))
cl = [0] * N
for i in range(N + 1):
	cl[li[i] - 1] += 1
hu = 0
for i in range(N):
	if cl[i] == 2:
		hu = i + 1
h1 = -1
h2 = -1
for i in range(N + 1):
	if h1 == -1 and li[i] == hu:
		h1 = i
	if h1 >= 0 and li[i] == hu:
		h2 = N - i
print(N)
for i in range(N):
	print((cmb(N + 1, i + 2, mod) - cmb(h1 + h2, i + 1, mod)) % mod)


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)


def egcd(a, b):
	if a == 0:
		return (b, 0, 1)
	else:
		(g, y, x) = egcd(b % a, a)
		return (g, x - b // a * y, y)

def modinv(a, m):
	(g, x, y) = egcd(a, m)
	if g != 1:
		raise Exception('modular inverse does not exist')
	else:
		return x % m
n = int(input())
A = list(map(int, input().split()))
C = [-1] * (n + 1)
lr = 0
for (i, a) in enumerate(A):
	if C[a] == -1:
		C[a] = i
	else:
		lr = C[a] + n - i
		break

def combination(n, mod):
	lst = [1]
	for i in range(1, n + 1):
		lst.append(lst[-1] * (n + 1 - i) % mod * modinv(i, mod) % mod)
	return lst
mod = 10 ** 9 + 7
NC = combination(n + 1, mod)
LRC = combination(lr, mod)
for i in range(1, n + 2):
	print((NC[i] - (LRC[i - 1] if i - 1 <= lr else 0)) % mod)


MOD = 10 ** 9 + 7
n = int(input())
la = list(map(int, input().split()))
L = [-1] * (n + 1)
l = 0
for i in range(n + 1):
	a = la[i]
	if L[a] == -1:
		L[a] = i
	else:
		l = i - L[a] - 1
		break
MAX = n
factorial = [1, 1]
inverse = [0, 1]
inverse_factorial = [1, 1]
for i in range(2, MAX + 1):
	factorial.append(factorial[-1] * i % MOD)
	inverse.append(-inverse[MOD % i] * (MOD // i) % MOD)
	inverse_factorial.append(inverse_factorial[-1] * inverse[-1] % MOD)

def C_MOD(n, k):
	if k < 0 or k > n:
		return 0
	k = min(k, n - k)
	return factorial[n] * inverse_factorial[k] * inverse_factorial[n - k] % MOD
print(n)
for i in range(2, n + 1):
	if n > l + 1:
		print((2 * C_MOD(n - 1, i - 1) - C_MOD(n - 1 - l, i - 1) + C_MOD(n - 1, i) + C_MOD(n - 1, i - 2)) % MOD)
	else:
		print((2 * C_MOD(n - 1, i - 1) + C_MOD(n - 1, i) + C_MOD(n - 1, i - 2)) % MOD)
print(1)


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)


MOD = 10 ** 9 + 7

class Fp(int):

	def __new__(self, x=0):
		return super().__new__(self, x % MOD)

	def inv(self):
		return self.__class__(super().__pow__(MOD - 2, MOD))

	def __add__(self, value):
		return self.__class__(super().__add__(value))

	def __sub__(self, value):
		return self.__class__(super().__sub__(value))

	def __mul__(self, value):
		return self.__class__(super().__mul__(value))

	def __floordiv__(self, value):
		return self.__class__(self * self.__class__(value).inv())

	def __pow__(self, value):
		return self.__class__(super().__pow__(value % (MOD - 1), MOD))
	__radd__ = __add__
	__rmul__ = __mul__

	def __rsub__(self, value):
		return self.__class__(-super().__sub__(value))

	def __rfloordiv__(self, value):
		return self.__class__(self.inv() * value)

	def __iadd__(self, value):
		self = self + value
		return self

	def __isub__(self, value):
		self = self - value
		return self

	def __imul__(self, value):
		self = self * value
		return self

	def __ifloordiv__(self, value):
		self = self // value
		return self

	def __ipow__(self, value):
		self = self ** value
		return self

	def __neg__(self):
		return self.__class__(super().__neg__())

class Combination:

	def __init__(self, max_n):
		self.max_n = 0
		self.fact = [Fp(1)]
		self.ifact = [Fp(1)]
		self.make_fact_list(max_n)

	def C(self, n, k):
		return self.fact[n] * self.ifact[k] * self.ifact[n - k] if 0 <= k <= n else 0

	def H(self, n, k):
		return self.C(n + k - 1, k) if n or k else 1

	def P(self, n, k):
		return self.fact[n] * self.ifact[n - k] if 0 <= k <= n else 0

	def make_fact_list(self, max_n):
		if max_n <= self.max_n:
			return
		self.fact += [Fp(0)] * (max_n - self.max_n)
		self.ifact += [Fp(0)] * (max_n - self.max_n)
		for i in range(self.max_n + 1, max_n + 1):
			self.fact[i] = self.fact[i - 1] * i
			self.ifact[i] = self.ifact[i - 1] // i
		self.max_n = max_n
N = int(input())
A = list(map(int, input().split()))
B = [-1] * (N + 1)
for (i, a) in enumerate(A):
	if B[a] >= 0:
		break
	B[a] = i
L = B[a]
R = N - i
M = i - B[a] - 2
print(N)
comb = Combination(N + 1)
for k in range(2, N + 2):
	print(comb.C(N + 1, k) - comb.C(L + R, k - 1))


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)