Limits 2s, 512 MB

Given an integer NN, find the number of elements which are even in the first NN rows of the Pascal's triangle. If you have forgotten, we have attached an image below which shows the first 11 rows of the Pascal's triangle.

The rows of Pascal's triangle are conventionally enumerated starting with row M=0M = 0 at the top (the 0-th row). The entries in each row are numbered from the left beginning with K=0K = 0. So the MM-th row of the pascal triangle consists of exactly M+1M+1 elements. And for each KK (0KM0 \leq K \leq M), the KK-th element of the MM-th row is basically (MK)\binom{M}{K} from left to right.

Input

The only line of the input contains a single integer NN (1N10181 \leq N \leq 10^{18}).

Output

Print a single integer, the number of elements which are even in the first NN rows of Pascal's triangle. As the answer can be very large, compute it modulo 109+7{10^9+7}.

Samples

InputOutput
3
1

In the first sample case, number of even elements in the first three rows are respectively 0, 0 and 1. Hence the answer is (0+0+1)=1(0+0+1) = 1.

InputOutput
5
4

Submit

Login to submit.

Statistics

75% Solution Ratio
NirjhorEarliest, Dec '18
NirjhorFastest, 0.0s
NirjhorLightest, 131 kB
Deshi_TouristShortest, 532B
Toph uses cookies. By continuing you agree to our Cookie Policy.