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: #include <bits/stdc++.h>
  using namespace std;
  #define rep(i, n) for (int i = 0; i < (int)(n); i++)
  #define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
  typedef int64_t Int;
  
  struct Combination{
      Int MOD, MAX_N;
      vector<Int> f, f_inv;
  
      //---------- 初期化 ----------
      Combination(Int mod = 1e9+7, Int max_n = 1e7){
          MOD = mod;
          MAX_N = max_n;
  
          f = factorial(MAX_N);
          rep(i,f.size()) f_inv.push_back(inv(f[i]));
      }
      
      //------- べき乗 a^n -------
      Int power(Int a, Int n){
          if(a == 0) return 0;
          if(n == 0) return 1;
  
          Int res = 1;
          while(n > 0){
              if(n % 2 == 1) res = res * a % MOD;
              a = a * a % MOD; n /= 2;
          }
          return res;
      }
  
      //------- 逆元 1/a -------
      Int inv(Int a){
          return power(a, MOD-2);
      }
  
      //------- 階乗 (nまでの階乗の配列を返す) -------
      vector<Int> factorial(Int n){
          vector<Int> res(n+1, 1);
          rep1(i,n) res[i] = i * res[i-1] % MOD;
  
          return res;
      }
  
  
      //------- 組み合わせ nCr -------
      Int comb(Int n, Int r){
          return (f[n] * f_inv[r] % MOD ) * f_inv[n-r] % MOD;
      }
  };
  
  int main(){
      Int N, twice, p;
      cin >> N;
  
      vector<Int> A(N+1), cnt(N,0);
      rep(i,N){
          cin >> A[i];
          cnt[A[i]-1]++;
          if(cnt[A[i]-1] == 2){
              twice = A[i];
              p = i;
          }
      }
  
      Combination C(1e9+7, 1e5+10);
      rep1(k,N+1){
          if(k == 1){
              cout << N << endl;
              continue;
          }
  
          Int ans = C.comb(N+1, k);
          if(N+1-p >= k) ans += C.MOD - C.comb(N+1-p, k);
          ans %= C.MOD;
          cout << ans << endl;
      }
  }
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."}]