n,*A=list(map(int,open(0).read().split()))

f=[1]*(n+2);r=f[:]

MOD=10**9+7

for i in range(n+1):f[i+1]=e=f[i]*-~i%MOD;r[i+1]=pow(e,MOD-2,MOD)

B=[0]*(n+1)

for a in A:B[a]+=1

i=B.index(2)

L=A.index(i);R=A.index(i,L+1)

for k in range(1,n+2):

    print(((f[n+1]*r[k]*r[n+1-k]-(k<=L+n+1-R and f[L-1+n+1-R]*r[k-1]*r[L+n+1-k-R]))%MOD))
n,*A=list(map(int,open(0).read().split()));n+=1;f=[1]*-~n;r=f[:];M=10**9+7

for a in A:r[a]+=1

i=r.index(3);d=A.index;L=d(i);L+=n-d(i,L+1);*X,=list(range(1,n+1))

for i in X:f[i]=e=f[i-1]*i%M;r[i]=pow(e,M-2,M)

for k in X:print(((f[n]*r[k]*r[n-k]-(k<=L)*(f[L-1]*r[k-1]*r[L-k]))%M))

n, *A = list(map(int, open(0).read().split()))
f = [1] * (n + 2)
r = f[:]
MOD = 10**9 + 7
for i in range(n + 1):
    f[i + 1] = e = f[i] * -~i % MOD
    r[i + 1] = pow(e, MOD - 2, MOD)
B = [0] * (n + 1)
for a in A:
    B[a] += 1
i = B.index(2)
L = A.index(i)
R = A.index(i, L + 1)
for k in range(1, n + 2):
    print(
        (
            (
                f[n + 1] * r[k] * r[n + 1 - k]
                - (
                    k <= L + n + 1 - R
                    and f[L - 1 + n + 1 - R] * r[k - 1] * r[L + n + 1 - k - R]
                )
            )
            % MOD
        )
    )

n, *A = list(map(int, open(0).read().split()))
n += 1
f = [1] * -~n
r = f[:]
M = 10**9 + 7
for a in A:
    r[a] += 1
i = r.index(3)
d = A.index
L = d(i)
L += n - d(i, L + 1)
(*X,) = list(range(1, n + 1))
for i in X:
    f[i] = e = f[i - 1] * i % M
    r[i] = pow(e, M - 2, M)
for k in X:
    print(((f[n] * r[k] * r[n - k] - (k <= L) * (f[L - 1] * r[k - 1] * r[L - k])) % M))

-f = [1] * (n + 2) +n += 1 +f = [1] * -~n -MOD = 10**9 + 7 -for i in range(n + 1): -    f[i + 1] = e = f[i] * -~i % MOD -    r[i + 1] = pow(e, MOD - 2, MOD) -B = [0] * (n + 1) +M = 10**9 + 7 -    B[a] += 1 -i = B.index(2) -L = A.index(i) -R = A.index(i, L + 1) -for k in range(1, n + 2): -    print( -        ( -            ( -                f[n + 1] * r[k] * r[n + 1 - k] -                - ( -                    k <= L + n + 1 - R -                    and f[L - 1 + n + 1 - R] * r[k - 1] * r[L + n + 1 - k - R] -                ) -            ) -            % MOD -        ) -    ) +    r[a] += 1 +i = r.index(3) +d = A.index +L = d(i) +L += n - d(i, L + 1) +(*X,) = list(range(1, n + 1)) +for i in X: +    f[i] = e = f[i - 1] * i % M +    r[i] = pow(e, M - 2, M) +for k in X: +    print(((f[n] * r[k] * r[n - k] - (k <= L) * (f[L - 1] * r[k - 1] * r[L - k])) % M))