CF878E Numbers on the blackboard

Description

A sequence of $ n $ integers is written on a blackboard. Soon Sasha will come to the blackboard and start the following actions: let $ x $ and $ y $ be two adjacent numbers ( $ x $ before $ y $ ), then he can remove them and write $ x+2y $ instead of them. He will perform these operations until one number is left. Sasha likes big numbers and will get the biggest possible number. Nikita wants to get to the blackboard before Sasha and erase some of the numbers. He has $ q $ options, in the option $ i $ he erases all numbers to the left of the $ l_{i} $ -th number and all numbers to the right of $ r_{i} $ -th number, i. e. all numbers between the $ l_{i} $ -th and the $ r_{i} $ -th, inclusive, remain on the blackboard. For each of the options he wants to know how big Sasha's final number is going to be. This number can be very big, so output it modulo $ 10^{9}+7 $ .

Input Format

N/A

Output Format

N/A

Explanation/Hint

In the second sample Nikita doesn't erase anything. Sasha first erases the numbers $ 1 $ and $ 2 $ and writes $ 5 $ . Then he erases $ 5 $ and -3 and gets -1. -1 modulo $ 10^{9}+7 $ is $ 10^{9}+6 $ .