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: import java.io.*;
import java.util.*;

class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(read.readLine());
		long[] arr = new long[N];
		StringTokenizer st = new StringTokenizer(read.readLine());

		long arrSum = 0;
		for(int i=0; i<N; i++) {
			arr[i] = Long.parseLong(st.nextToken());
			arrSum += arr[i];

		}

		int Q = Integer.parseInt(read.readLine());

		while(Q-- > 0) {
			StringTokenizer newLR = new StringTokenizer(read.readLine());

			int L = Integer.parseInt(newLR.nextToken());
			int R = Integer.parseInt(newLR.nextToken());

			long firstSum = 0;
			for(int i=L-1; i<R; i++) {
				firstSum += arr[i];
			}
			long res = (long)((arrSum - firstSum)%(Math.pow(10,9)+7));
			System.out.println(res);

		}

	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?