Problem D
Multiplication
Task
Given $N$ integers $a_1, a_2, ..., a_ N$. Calculate their product modulo $10^9 + 7$.
Input
The first line contains one integer $N$.
Then, $N$ lines follow. The $i$-th line contains integer $a_ i$.
Output
Output one integer - the product of the given numbers, taken modulo $10^9 + 7$.
Constraints
-
$1 \leq N \leq 10^3$
-
$1 \leq a_ i \leq 10^{18}$ (for all $1 \leq i \leq N$)
Subtasks
No. |
Points |
Additional constraints |
1 |
35 |
$N \leq 5$, and all $a_ i \leq 10$. |
2 |
64 |
All $a_ i \leq 10^9$. |
3 |
1 |
No additional constraints. |
Sample Input 1 | Sample Output 1 |
---|---|
2 2 2 |
4 |