Someone provides you a binary number N and asked you to process the Q queries. In each query, you have been given a number K and want you to flip the first K bits of the number from left to right.
Input
Output
In each query, print the decimal representation of X mod 109 + 7 after the flip.
Constraints
Initially, the binary number is 011 so the value is 3 but if you will flip the first 2 bits then the number changes to 101 whose value is 5 so the output for the query 1 is 5