Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ACM-ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

No tag edit access

D. Multipliers

time limit per test

2 secondsmemory limit per test

256 megabytesinput

standard inputoutput

standard outputAyrat has number *n*, represented as it's prime factorization *p*_{i} of size *m*, i.e. *n* = *p*_{1}·*p*_{2}·...·*p*_{m}. Ayrat got secret information that that the product of all divisors of *n* taken modulo 10^{9} + 7 is the password to the secret data base. Now he wants to calculate this value.

Input

The first line of the input contains a single integer *m* (1 ≤ *m* ≤ 200 000) — the number of primes in factorization of *n*.

The second line contains *m* primes numbers *p*_{i} (2 ≤ *p*_{i} ≤ 200 000).

Output

Print one integer — the product of all divisors of *n* modulo 10^{9} + 7.

Examples

Input

2

2 3

Output

36

Input

3

2 3 2

Output

1728

Note

In the first sample *n* = 2·3 = 6. The divisors of 6 are 1, 2, 3 and 6, their product is equal to 1·2·3·6 = 36.

In the second sample 2·3·2 = 12. The divisors of 12 are 1, 2, 3, 4, 6 and 12. 1·2·3·4·6·12 = 1728.

Codeforces (c) Copyright 2010-2017 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Apr/28/2017 17:19:15 (c4).

Desktop version, switch to mobile version.
User lists

Name |
---|