// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x) cout << #x << ' ' << '=' << ' ' << (x) << endl;
#define fs first
#define sc second
#define pb push_back
typedef long long ll;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;
typedef priority_queue<ll> PQI;
typedef priority_queue<P> PQP;
typedef vector<vector<P>> pvec;
typedef vector<vector<ll>> vvec;
typedef vector<ll> vec;
const vector<int> dx = {0, -1, 0, 1, 1, 1, -1, -1};
const vector<int> dy = {1, 0, -1, 0, 1, -1, 1, -1};
const int MOD = (1000000007);
// const int MOD = (998244353);
// const int INF = (1 << 30);
const int INF = (1LL << 60);
const double EPS = (1 >> 30);
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return 1;} return 0;}

#include <cstdint>
 
template <long long Modulus> class modint {
  long long a;
 
public:
  constexpr modint(const long long x = 0) noexcept : a((x % Modulus + Modulus) % Modulus) {}
  constexpr long long val() const noexcept { return a; }
  constexpr modint operator+(const modint rhs) const noexcept {
    return modint(*this) += rhs;
  }
  constexpr modint operator-(const modint rhs) const noexcept {
    return modint(*this) -= rhs;
  }
  constexpr modint operator*(const modint rhs) const noexcept {
    return modint(*this) *= rhs;
  }
  constexpr modint operator/(const modint rhs) const noexcept {
    return modint(*this) /= rhs;
  }
  constexpr bool operator==(const modint rhs) const noexcept {
    return modint(*this).val() == rhs.val();
  }
  modint &operator+=(const modint rhs) noexcept {
    a += rhs.a;
    if (a >= Modulus) {
      a -= Modulus;
    }
    return *this;
  }
  modint &operator-=(const modint rhs) noexcept {
    if (a < rhs.a) {
      a += Modulus;
    }
    a -= rhs.a;
    return *this;
  }
  modint &operator*=(const modint rhs) noexcept {
    a = a * rhs.a % Modulus;
    return *this;
  }
  modint &operator/=(modint rhs) noexcept {
    long long exp = Modulus - 2;
    while (exp) {
      if (exp % 2) {
        *this *= rhs;
      }
      rhs *= rhs;
      exp /= 2;
    }
    return *this;
  }
};
using mint = modint<MOD>;
typedef vector<mint> mvec;
typedef vector<vector<mint>> mvvec;

mvec fact(100000+10);
mint cnr(int n,int r){
    return (fact[n]/(fact[r]*fact[n-r]));
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(15);
    //---------------------------------------------
    
    int n;
    cin>>n;
    n++;
    vector<int> a(n);
    REP(i,n) cin >> a[i];
    vec b(n);
    int memo1,memo2=0;
    int num;
    rep(i,n){
        b[a[i]-1]++;
        if(b[a[i]-1]==2){
            memo1=i;
            num=a[i];
        }
    }
    // cout<<memo1<<" "<<num<<endl;
    vec d(3);
    rep(i,n){
        if(num==a[i]){
            memo2++;
            continue;
        }
        d[memo2]++;
    }
    // rep(i,3) debug(d[i]);

    // d[0] + 1 + d[1] + 1 + d[2] = n

    fact[0]=1;
    rep(i,100000+10){
        if(i!=0) fact[i]=fact[i-1]*i;
    }

    rep(i,n+1){
        if(i==0) continue;
        if(i==1){
            cout<<n-1<<endl;
            continue;
        }
        mint g=fact[n]/fact[i]/fact[n-i];
        if( (d[0]+d[2]-(i-1)) >= 0 ){
            g-=fact[d[0]+d[2]]/fact[i-1]/fact[d[0]+d[2]-(i-1)];
        }
        cout<<g.val()<<endl;
    }
}

Measured memory_bytes: 3584