PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GL0000210. Tích của mọi ước (Multipliers)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Tích của mọi ước (Multipliers)

Tích của mọi ước (Multipliers)

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

A positive integer XX is given as a multiset of mm primes p1,…,pmp_1,\ldots,p_m, so X=∏i=1mpiX=\prod_{i=1}^{m}p_i. Find the product of all distinct positive divisors of XX modulo 109+710^9+7, without constructing XX.

Input

The first line contains mm; the second line contains mm primes pip_i, possibly repeated.

Output

Print one integer in the range 00 to 109+610^9+6.

Subtasks

  • Subtask 1 (20 points): 1≤m≤101\le m\le 10; mỗi pip_i là số nguyên tố, 2≤pi≤1002\le p_i\le 100.

  • Subtask 2 (30 points): 1≤m≤30001\le m\le 3000; mỗi pip_i là số nguyên tố, 2≤pi≤100002\le p_i\le 10000.

  • Subtask 3 (50 points): 1≤m≤2000001\le m\le 200000; mỗi pip_i là số nguyên tố, 2≤pi≤2000002\le p_i\le 200000.

Examples

Example 1

Input

2
2 3

Output

36

Explanation

6 has divisors 1,2,3,6; their product is 36.

Example 2

Input

3
2 3 2

Output

1728

Explanation

12 has divisors 1,2,3,4,6,12 whose product is 1728.

Example 3

Input

1
2

Output

2

Explanation

2 has divisors 1 and 2; their product is 2.