n = int(eval(input()))

A= list(map(int, input().split()))



mod = int(1e9+7)

def powermod(a, n, mod):

    r = 1

    while n>=1:

        if n%2:

            r = (r*a)%mod

        a = (a*a)%mod

        n = n//2

    return r

  

memo={}

for i, a in enumerate(A):

  if a in memo:

    L = memo[a]

    C = i - memo[a] -1

    R = len(A) - i-1

    break

  else:

    memo[a] = i

    

#print(L,C,R)

_LR = [0]*(n+3)

_LCR = [0] * (n+3) # _LCR[k] = (L+C+R)C(k)

_k = [0] * (n+3)

_LR[0] = _LCR[0] = _k[0] = 1



LR = [0]*(n+2) #LR[k] = (L+R)C(k)

LR[0] = 1

#LDR = [0]*(n+2)

#LDDR = [0]*(n+2)



LCR = [0] * (n+2) # LCR[k] = _LCR[k] - LR[k]

#LDCR = [0] * (n+2) #最後に*2を忘れないこと

#LDCDR = [0] * (n+2)



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

  _LR[k] = (_LR[k-1] * (L+R+1-k)) %mod

  _LCR[k] = (_LCR[k-1] * (L+C+R+1-k))% mod

  _k[k] = (_k[k-1] * powermod(k, mod-2, mod)) %mod

  

  LR[k] = (_LR[k] * _k[k])%mod

#  LDR[k] = LR[k-1]

#  LDDR[k] = LDR[k-1]

  

  LCR[k] = (_LCR[k] * _k[k])%mod - LR[k]

#  LDCR[k] = LCR[k-1]

#  LDCDR[k] = LDCR[k-1]

  #print(LR, LCR)

  print(((LR[k] + LR[k-1] + LR[k-2] + LCR[k] + 2*LCR[k-1] + LCR[k-2])%mod))

  

#print(LR)

#print(LDR)

#print(LDDR)

#print(_LCR)

#print(LCR)

#print(LDCR)

#print(LDCDR)

n = int(eval(input()))

A= list(map(int, input().split()))



mod = int(1e9+7)

def invmod(a, mod):

    if a==1:

        return 1

    return -invmod(mod%a, mod) * (mod//a) %mod





memo={}

for i, a in enumerate(A):

  if a in memo:

    L = memo[a]

    C = i - memo[a] -1

    R = len(A) - i-1

    break

  else:

    memo[a] = i

    

#print(L,C,R)

_LR = [0]*(n+3)

_LCR = [0] * (n+3) # _LCR[k] = (L+C+R)C(k)

_k = [0] * (n+3)

_LR[0] = _LCR[0] = _k[0] = 1



LR = [0]*(n+2) #LR[k] = (L+R)C(k)

LR[0] = 1

#LDR = [0]*(n+2)

#LDDR = [0]*(n+2)



LCR = [0] * (n+2) # LCR[k] = _LCR[k] - LR[k]

#LDCR = [0] * (n+2) #最後に*2を忘れないこと

#LDCDR = [0] * (n+2)



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

  _LR[k] = (_LR[k-1] * (L+R+1-k)) %mod

  _LCR[k] = (_LCR[k-1] * (L+C+R+1-k))% mod

  _k[k] = (_k[k-1] * invmod(k,mod)) %mod

  

  LR[k] = (_LR[k] * _k[k])%mod

#  LDR[k] = LR[k-1]

#  LDDR[k] = LDR[k-1]

  

  LCR[k] = (_LCR[k] * _k[k])%mod - LR[k]

#  LDCR[k] = LCR[k-1]

#  LDCDR[k] = LDCR[k-1]

  #print(LR, LCR)

  print(((LR[k] + LR[k-1] + LR[k-2] + LCR[k] + 2*LCR[k-1] + LCR[k-2])%mod))

  

#print(LR)

#print(LDR)

#print(LDDR)

#print(_LCR)

#print(LCR)

#print(LDCR)

#print(LDCDR)
n = int(eval(input()))
A = list(map(int, input().split()))
mod = int(1e9 + 7)


def powermod(a, n, mod):
    r = 1
    while n >= 1:
        if n % 2:
            r = (r * a) % mod
        a = (a * a) % mod
        n = n // 2
    return r


memo = {}
for i, a in enumerate(A):
    if a in memo:
        L = memo[a]
        C = i - memo[a] - 1
        R = len(A) - i - 1
        break
    else:
        memo[a] = i
# print(L,C,R)
_LR = [0] * (n + 3)
_LCR = [0] * (n + 3)  # _LCR[k] = (L+C+R)C(k)
_k = [0] * (n + 3)
_LR[0] = _LCR[0] = _k[0] = 1
LR = [0] * (n + 2)  # LR[k] = (L+R)C(k)
LR[0] = 1
# LDR = [0]*(n+2)
# LDDR = [0]*(n+2)
LCR = [0] * (n + 2)  # LCR[k] = _LCR[k] - LR[k]
# LDCR = [0] * (n+2) #最後に*2を忘れないこと
# LDCDR = [0] * (n+2)
for k in range(1, n + 2):
    _LR[k] = (_LR[k - 1] * (L + R + 1 - k)) % mod
    _LCR[k] = (_LCR[k - 1] * (L + C + R + 1 - k)) % mod
    _k[k] = (_k[k - 1] * powermod(k, mod - 2, mod)) % mod
    LR[k] = (_LR[k] * _k[k]) % mod
    #  LDR[k] = LR[k-1]
    #  LDDR[k] = LDR[k-1]
    LCR[k] = (_LCR[k] * _k[k]) % mod - LR[k]
    #  LDCR[k] = LCR[k-1]
    #  LDCDR[k] = LDCR[k-1]
    # print(LR, LCR)
    print(
        ((LR[k] + LR[k - 1] + LR[k - 2] + LCR[k] + 2 * LCR[k - 1] + LCR[k - 2]) % mod)
    )
# print(LR)
# print(LDR)
# print(LDDR)
# print(_LCR)
# print(LCR)
# print(LDCR)
# print(LDCDR)

n = int(eval(input()))
A = list(map(int, input().split()))
mod = int(1e9 + 7)


def invmod(a, mod):
    if a == 1:
        return 1
    return -invmod(mod % a, mod) * (mod // a) % mod


memo = {}
for i, a in enumerate(A):
    if a in memo:
        L = memo[a]
        C = i - memo[a] - 1
        R = len(A) - i - 1
        break
    else:
        memo[a] = i
# print(L,C,R)
_LR = [0] * (n + 3)
_LCR = [0] * (n + 3)  # _LCR[k] = (L+C+R)C(k)
_k = [0] * (n + 3)
_LR[0] = _LCR[0] = _k[0] = 1
LR = [0] * (n + 2)  # LR[k] = (L+R)C(k)
LR[0] = 1
# LDR = [0]*(n+2)
# LDDR = [0]*(n+2)
LCR = [0] * (n + 2)  # LCR[k] = _LCR[k] - LR[k]
# LDCR = [0] * (n+2) #最後に*2を忘れないこと
# LDCDR = [0] * (n+2)
for k in range(1, n + 2):
    _LR[k] = (_LR[k - 1] * (L + R + 1 - k)) % mod
    _LCR[k] = (_LCR[k - 1] * (L + C + R + 1 - k)) % mod
    _k[k] = (_k[k - 1] * invmod(k, mod)) % mod
    LR[k] = (_LR[k] * _k[k]) % mod
    #  LDR[k] = LR[k-1]
    #  LDDR[k] = LDR[k-1]
    LCR[k] = (_LCR[k] * _k[k]) % mod - LR[k]
    #  LDCR[k] = LCR[k-1]
    #  LDCDR[k] = LDCR[k-1]
    # print(LR, LCR)
    print(
        ((LR[k] + LR[k - 1] + LR[k - 2] + LCR[k] + 2 * LCR[k - 1] + LCR[k - 2]) % mod)
    )
# print(LR)
# print(LDR)
# print(LDDR)
# print(_LCR)
# print(LCR)
# print(LDCR)
# print(LDCDR)

-def powermod(a, n, mod): -    r = 1 -    while n >= 1: -        if n % 2: -            r = (r * a) % mod -        a = (a * a) % mod -        n = n // 2 -    return r +def invmod(a, mod): +    if a == 1: +        return 1 +    return -invmod(mod % a, mod) * (mod // a) % mod -    _k[k] = (_k[k - 1] * powermod(k, mod - 2, mod)) % mod +    _k[k] = (_k[k - 1] * invmod(k, mod)) % mod