#K83002. Sum of Fibonacci Sequence Terms

    ID: 36100 Type: Default 1000ms 256MiB

Sum of Fibonacci Sequence Terms

Sum of Fibonacci Sequence Terms

Given a positive integer \(p\), calculate the sum of the first \(p\) Fibonacci numbers modulo \(10^9+7\). The Fibonacci sequence is defined as follows: \(F_1=1\), \(F_2=1\), and for \(n \ge 3\), \(F_n=F_{n-1}+F_{n-2}\). More formally, the task is to compute \(S(p) = \sum_{i=1}^{p} F_i \; (\text{mod }10^9+7)\).

For example, when \(p=5\), the Fibonacci sequence is 1, 1, 2, 3, 5 and the sum \(S(5)=1+1+2+3+5=12\).

inputFormat

The input begins with an integer \(T\) denoting the number of test cases. Each of the next \(T\) lines contains a single integer \(p\) representing the number of Fibonacci terms to sum. You can assume that \(p\) is a positive integer.

outputFormat

For each test case, output the sum of the first \(p\) Fibonacci numbers modulo \(10^9+7\) on a new line.

## sample
1
5
12

</p>