#K12786. Maximum Sum Under Modulo Operation
Maximum Sum Under Modulo Operation
Maximum Sum Under Modulo Operation
You are given a list of integers. Your task is to compute the sum of all elements in the list and then take the result modulo \(10^9+7\). This operation is important when dealing with large sums to avoid overflow issues.
Task: Compute \(\sum_{i=1}^{n} a_i \mod (10^9+7)\) where \(a_i\) are the given numbers.
inputFormat
The input consists of two lines:
- The first line contains a single integer \(n\) denoting the number of elements.
- The second line contains \(n\) space-separated integers.
outputFormat
Output a single integer, the sum of the given numbers modulo \(10^9+7\).
## sample3
1 2 3
6
</p>