Standard stack sizes in Minecraft are $$$2^6=64$$$ for most blocks and items, $$$2^4=16$$$ for select items, and $$$2^0=1$$$ for tools and special items. However, Mojang's latest update has a lot of bugs, forcing items to stack to exactly any integer power of $$$2$$$, including powers greater than $$$64$$$: $$$128$$$, $$$256$$$, and so on! Since you were down in your mineshaft before the update dropped, you decide to use the opportunity to start moving your supply of gems back to your base above ground.
You have diamonds and emeralds in the mineshaft's storage that you want to bring, but you can't put them in your inventory since you're carrying lots of other important items (i.e. Pigstep and deadbushes). But, you do have a bundle, a portable container that fits exactly $$$N$$$ items. Due to another bug in the update, you can only insert stacks of items in alternating order, but you can start with either diamonds or emeralds. For example, if you first insert a power-of-two stack of diamonds, the next stack you insert must be a power-of-two stack of emeralds.
For example, the bundle might be able to fit $$$4$$$ gems. There are $$$12$$$ possible ways to put them in, shown below. Note that each sequence of the same item must have a length matching some power of $$$2$$$; as such, a length of $$$3$$$ is unable to be added to the bundle.
DEDE, EDED, DDED, EEDE, DEED, EDDE, DEDD, EDEE, DDEE, EEDD, DDDD, EEEE
You're curious about how many different ways you could completely fill your bundle. Given the capacity of the bundle $$$N$$$, determine how many different ways the bundle can be filled. Assume that you have at least $$$N$$$ gems of each type.
The only line of input is integer $$$N$$$ $$$(1 \le N \le 10^5)$$$: the capacity of your bundle.
Output a single integer: the number of ways that you could fill your bundle $$$\text{mod}$$$ $$$10^9+7$$$.
4
12
5
20
67
564649932
6767
349469276
| Name |
|---|


