You are given N integers A1,A2,...,AN and Q queries. In each query, you are given two integers L and R (1≤L≤R≤N).
For each query, write a program to find the value of the following expression:
GCD(F(AL),F(AL+1),F(AL+2)......F(AR))%109+7
Input format
Output format
For each query, print the value of the expression.
Note
The Fibonacci series is defined as:
F(N) = F(N−1)+F(N−2) ∀ N≥3
F(1)=1 , F(2)=1
The GCD of two numbers is the greatest common divisor of those numbers. For example, GCD(2,4) = 2.
Constraints
1≤N≤105
1≤Q≤105
1≤Ai≤109
1≤L≤R≤N
For query 1: GCD(F(2) , F(4), F(8))= GCD(1,3,21)=1 For query 2: GCD(F(4), F(8))= GCD(3,21)=3