def main(): N = int(input()) *A, = map(int, input().split()) def f(x): a = 1 for i in range(1, x+1): a *= i return a ans = f(N) for i in range(1, N+1): ans //= f(A.count(i)) print(ans) if __name__ == '__main__': main()