#K78112. Even Sum Modulo Calculation
Even Sum Modulo Calculation
Even Sum Modulo Calculation
You are given an array of integers. Compute the sum of the array elements. If the sum is even, output the sum modulo \(10^9+7\); otherwise, output -1.
In other words, let \(S\) be the sum of the array. If \(S \bmod 2 = 0\), then print \(S \bmod (10^9+7)\); otherwise, print -1.
inputFormat
The first line contains an integer \(N\) representing the number of elements in the array. The second line contains \(N\) space-separated integers.
outputFormat
Output a single integer: the sum of the array modulo \(10^9+7\) if the sum is even, or -1 if the sum is odd.
## sample3
1 2 3
6