64. Product Modulo
EasyModular Arithmetic
Print the product of all elements modulo 1,000,000,007. The result must be in the range 0 to 10⁹ + 6.
Input format
Line 1: n Line 2: n integers
Output format
The product mod 10⁹ + 7.
Example 1
Input
3 2 3 4
Output
24
Example 2
Input
2 -1 5
Output
1000000002
Constraints
1 ≤ n ≤ 10⁵ |values| ≤ 10⁹
Read input from standard input and print the answer to standard output. Your code is judged against 6 test cases, most of them hidden.
Loading the MyLoginn IDE…