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: from collections import Counter
  
  
  class Mint:
      MOD = 1000000007  # Must be a prime
      CACHE_FACTORIALS = [1, 1]
  
      def __init__(self, v):
          if self.__isally(v):
              self.v = v.v % self.MOD
          else:
              self.v = v % self.MOD
  
      @property
      def inv(self):
          return Mint(self.__minv(self.v))
  
      @classmethod
      def factorial(cls, v):
          for i in range(len(cls.CACHE_FACTORIALS), int(v) + 1):
              cls.CACHE_FACTORIALS.append(cls.CACHE_FACTORIALS[-1] * i % cls.MOD)
          return Mint(cls.CACHE_FACTORIALS[int(v)])
  
      @classmethod
      def perm(cls, n, r):
          if n < r or r < 0:
              return 0
          return cls.factorial(n) // cls.factorial(n - r)
  
      @classmethod
      def comb(cls, n, r):
          if n < r or r < 0:
              return 0
          return cls.perm(n, r) // cls.factorial(r)
  
      @classmethod
      def __isally(cls, v) -> bool:
          return isinstance(v, cls)
  
      @classmethod
      def __minv(cls, v) -> int:
          return pow(v, cls.MOD - 2, cls.MOD)
  
      @classmethod
      def __mpow(cls, v, w) -> int:
          return pow(v, w, cls.MOD)
  
      def __str__(self):
          return str(self.v)
  
      __repr__ = __str__
  
      def __int__(self):
          return self.v
  
      def __eq__(self, w):
          return self.v == w.v if self.__isally(w) else self.v == w
  
      def __add__(self, w):
          return Mint(self.v + w.v) if self.__isally(w) else Mint(self.v + w)
  
      __radd__ = __add__
  
      def __sub__(self, w):
          return Mint(self.v - w.v) if self.__isally(w) else Mint(self.v - w)
  
      def __rsub__(self, u):
          return Mint(u.v - self.v) if self.__isally(u) else Mint(u - self.v)
  
      def __mul__(self, w):
          return Mint(self.v * w.v) if self.__isally(w) else Mint(self.v * w)
  
      __rmul__ = __mul__
  
      def __floordiv__(self, w):
          return (
              Mint(self.v * self.__minv(w.v))
              if self.__isally(w)
              else Mint(self.v * self.__minv(w))
          )
  
      def __rfloordiv__(self, u):
          return (
              Mint(u.v * self.__minv(self.v))
              if self.__isally(u)
              else Mint(u * self.__minv(self.v))
          )
  
      def __pow__(self, w):
          return (
              Mint(self.__mpow(self.v, w.v))
              if self.__isally(w)
              else Mint(self.__mpow(self.v, w))
          )
  
      def __rpow__(self, u):
          return (
              Mint(self.__mpow(u.v, self.v))
              if self.__isally(u)
              else Mint(self.__mpow(u, self.v))
          )
  
  
  N = int(input())
  A = [int(s) for s in input().split()]
  v = Counter(A).most_common(1)[0][0]
  i = A.index(v)
  j = A.index(v, i + 1)
  l = i
  m = j - i - 1
  n = N - j
  for k in range(1, N + 2):
      ans = (
          Mint.comb(l + m + n, k)
          + Mint.comb(l + m + n, k - 1) * 2
          - Mint.comb(l + n, k - 1)
          + Mint.comb(l + m + n, k - 2)
      )
      print(ans)
  
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."}]