For this Question: You are given an array A of N integers. You will be given Q queries with two integers L and R. For each query, you need to find the sum of all elements of the array excluding the elements in the range [L, R] (both inclusive) modulo 10<sup>9</sup>+7.The first line of the input contains an integer N, the size of the array.
The second line of the input contains N integers, the elements of the array A.
The third line of the input contains an integer Q.
The next Q lines contain two integers L and R.

Constraints
1 <= N <= 200000
1 <= A[i] <= 1000000000
1 <= Q <= 3
1 <= L <= R <= NOutput Q lines, each having a single integer the answer to Q-th query.Sample Input
4
5 3 3 1
2
2 3
4 4

Sample Output
6
11

Explanation: The array A = [5, 3, 3, 1].
First Query: Sum = 5 + 1 = 6.
Second Query: Sum = 5 + 3 + 3 = 11, I have written this Solution Code: def prefixSum(arr,n):
	prefixSum = [0]*(n+1)
	prefixSum[1] = arr[1]
	for i in range(2,n+1):
		prefixSum[i] = prefixSum[i-1]+arr[i]
	return prefixSum


n = int(input())
arr = list(map(int,input().split()))
arr = [0] + arr
Q = int(input())
prefixSum = prefixSum(arr,n)
for i in range(Q):
	L,R = map(int,input().split())
	sum1 = (prefixSum[n] - (prefixSum[R] - prefixSum[L-1]))%1000000007
	print(sum1), In this Programming Language: Python, Now tell me if this Code is compilable or not?