output_description: 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.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      n
      a_1 a_2 ... a_{n+1}
attempt: # -*- coding: utf-8 -*-
  from collections import Counter
  
  # 参考サイト
  # http://arc058.contest.atcoder.jp/data/arc/058/editorial.pdf
  
  N = int(input())
  As = list(map(int, input().split()))
  cnt = Counter(As)
  dup, _ = cnt.most_common(1)[0]
  # print(cnt.most_common(1)[0])
  a = As.index(dup)  # 重複数字の最初の場所
  As[a] = -1
  b = As.index(dup)  # 重複数字の次の場所
  
  MOD = 1000000007
  
  if N == 1:
      print(1)
      print(1)
      exit()
  
  
  # def nCr(n, r):
  #     # 10C7 = 10C3
  #     r = min(r, n-r)
  #     # Calculate the numerator.
  #     numerator = 1
  #     for i in range(n, n-r, -1):
  #         numerator *= i
  #     for i in range(r, 1, -1):
  #         numerator //= i
  #     return numerator
  def modc(a, b, m):
      b = min(b, a - b)
      c = 1
      for i in range(b):
          c = c * (a - i) % m
          c = c * modinv(i + 1, m) % m
      return c
  
  
  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 modinv(a, m):
      (inv, q, gcd_val) = egcd(a, m)
      return inv % m
  
  
  # print(a,b)
  print(N)  # 文字列1
  for k in range(2, N):
      # tmp1 = nCr(N+1, k)
      # tmp2 = nCr(N-1+a-b, k-1)
      # tmp1 = C(N+1, k)
      # tmp2 = C(N-1+a-b, k-1)
      tmp1 = modc(N + 1, k, MOD)
      tmp2 = modc(N - 1 + a - b, k - 1, MOD)
      # print(tmp1, tmp2)
      print(tmp1 - tmp2)
  print(N + 1)  # 文字列N
  print(1)  # 文字列N+1
  
problem_description: Statement
  
  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.
samples: [{"input": "3\n    1 2 1 3", "output": "3\n    5\n    4\n    1\n    \n\nThere are three subsequences with length 1: 1 and 2 and 3.\n\nThere are five subsequences with length 2: 1,1 and 1,2 and 1,3 and 2,1 and\n2,3.\n\nThere are four subsequences with length 3: 1,1,3 and 1,2,1 and 1,2,3 and\n2,1,3.\n\nThere is one subsequence with length 4: 1,2,1,3.\n\n* * *"}, {"input": "1\n    1 1", "output": "1\n    1\n    \n\nThere is one subsequence with length 1: 1.\n\nThere is one subsequence with length 2: 1,1.\n\n* * *"}, {"input": "32\n    29 19 7 10 26 32 27 4 11 20 2 8 16 23 5 14 6 12 17 22 18 30 28 24 15 1 25 3 13 21 19 31 9", "output": "32\n    525\n    5453\n    40919\n    237336\n    1107568\n    4272048\n    13884156\n    38567100\n    92561040\n    193536720\n    354817320\n    573166440\n    818809200\n    37158313\n    166803103\n    166803103\n    37158313\n    818809200\n    573166440\n    354817320\n    193536720\n    92561040\n    38567100\n    13884156\n    4272048\n    1107568\n    237336\n    40920\n    5456\n    528\n    33\n    1\n    \n\nBe sure to print the numbers modulo 10^9+7."}]