Justin is lost in a maze and needs to find a way out. The maze consists of n rooms numbered from 1 to n. Each room is encoded with a natural number from 0 to 2^{30}-1.
Justin is currently in room 1. In this room, there are instructions that Justin can move from room a to room b if and only if:
At the same time, the number of ways Justin moves from room a to room b is equal to the number of natural numbers k that satisfy the above requirement. Justin knows that he needs to reach room n to escape the maze.
How many ways are there for Justin to move from room 1 to room n? Two ways are considered different if Justin passes through a room in one way but not in the other, or if Justin uses two different ways to move between two rooms. Additionally, because the answer can be very large, only give the answer modulo 10^9+7.
Print a single integer which is the number of ways for Justin to move from room 1 to room n modulo 10^9+7
Dữ liệu vào Sao chép |
4 1 3 3 1 |
Dữ liệu ra Sao chép |
5 |
Dữ liệu vào Sao chép |
9 1 3 5 7 9 11 13 15 17 |
Dữ liệu ra Sao chép |
732 |