Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter, defaultdict
import sys
sys.setrecursionlimit(10 ** 5 + 10)
# input = sys.stdin.readline
from math import factorial
import heapq, bisect
import math
import itertools

import queue
from collections import deque


def comb(n, r, mod):
    if n < r:
        return 0
    ans = 1
    for i in range(max(r, n - r) + 1, n + 1):
        ans *= i
        ans %= mod
    for i in range(1, min(r, n - r) + 1):
        ans *= pow(i, mod - 2, mod)
        ans %= mod
    return ans


def main():
    num = int(input())
    data = list(map(int, input().split()))

    mod = 10 ** 9 + 7

    count_data = Counter(data)
    count_data = sorted(count_data.items(), key=lambda x: -x[1])
    two_num = count_data[0][0]

    flg = 0
    left, mid, right = 0, 0, 0

    for i in range(num + 1):
        if data[i] == two_num:
            flg += 1
        elif flg == 0:
            left += 1
        elif flg == 1:
            mid += 1
        else:
            right += 1


    for now_num in range(1, num + 2):
        ans = 0
        if now_num == 1:
            ans += num
        elif now_num == 2:
            ans += comb(num - 1, 2, mod)
            ans += 1
            ans += left + right + mid * 2
        else:
            ans += comb(num - 1, now_num, mod)
            # print('uu', ans)
            ans += comb(num - 1, now_num - 2, mod)
            # kari = comb(left + right, now_num - 2, mod) - comb(left, now_num - 2, mod) - comb(right, now_num - 2, mod)
            # ans -= kari
            # print('uu', ans)
            ans += comb(num - 1, now_num - 1, mod) * 2 - comb(left, now_num - 1, mod) - comb(right, now_num - 1, mod)
            kari = comb(left + right, now_num - 1, mod) - comb(left, now_num - 1, mod) - comb(right, now_num - 1, mod)
            # print(kari, 'jjjj')
            ans -= kari
            # print(comb(num - 1, now_num - 1, mod), comb(num - 1, now_num - 1, mod), comb(num - 1, now_num - 1, mod))
            # print('uu', ans)
        # print(ans, left, mid, right)
        ans %= mod
        print(ans)


if __name__ == '__main__':
    main()
    # test()


Fixed submission:
from collections import Counter, defaultdict
import sys
sys.setrecursionlimit(10 ** 5 + 10)
# input = sys.stdin.readline
from math import factorial
import heapq, bisect
import math
import itertools

import queue
from collections import deque

def comb(n, r, mod, bunsi):
    if r > n:
        return 0
    ans = bunsi[n] * pow(bunsi[r], mod - 2, mod) * pow(bunsi[n - r], mod - 2, mod)
    return ans


def main():
    num = int(input())
    data = list(map(int, input().split()))

    mod = 10 ** 9 + 7

    count_data = Counter(data)
    count_data = sorted(count_data.items(), key=lambda x: -x[1])
    two_num = count_data[0][0]

    flg = 0
    left, mid, right = 0, 0, 0

    for i in range(num + 1):
        if data[i] == two_num:
            flg += 1
        elif flg == 0:
            left += 1
        elif flg == 1:
            mid += 1
        else:
            right += 1

    bunsi = [0 for i in range(num + 10)]
    bunsi[1] = 1
    bunsi[0] = 1
    for i in range(2, num + 10):
        bunsi[i] = (bunsi[i - 1] * i) % mod


    for now_num in range(1, num + 2):
        ans = 0
        if now_num == 1:
            ans += num
        elif now_num == 2:
            ans += comb(num - 1, 2, mod, bunsi)
            ans += 1
            ans += left + right + mid * 2
        else:
            ans += comb(num - 1, now_num, mod, bunsi)
            ans += comb(num - 1, now_num - 2, mod, bunsi)
            ans += comb(num - 1, now_num - 1, mod, bunsi) * 2 - comb(left, now_num - 1, mod, bunsi) - comb(right, now_num - 1, mod, bunsi)
            kari = comb(left + right, now_num - 1, mod, bunsi) - comb(left, now_num - 1, mod, bunsi) - comb(right, now_num - 1, mod, bunsi)
            ans -= kari

        ans %= mod
        print(ans)


if __name__ == '__main__':
    main()
    # test()