Everyone knows what the Fibonacci sequence is. This sequence can be defined by the recurrence relation: 

We'll define a new number sequence *A*<sub class="lower-index">*i*</sub>(*k*) by the formula: 

In this problem, your task is to calculate the following sum: *A*<sub class="lower-index">1</sub>(*k*) + *A*<sub class="lower-index">2</sub>(*k*) + ... + *A*<sub class="lower-index">*n*</sub>(*k*). The answer can be very large, so print it modulo 1000000007 (10<sup class="upper-index">9</sup> + 7).
The first line contains two space-separated integers *n*, *k* (1 ≤ *n* ≤ 10<sup class="upper-index">17</sup>; 1 ≤ *k* ≤ 40).
inputlist = list(map(int, input().split(' ')))
n = inputlist[0]
k = inputlist[1]
module = 1000000007
bin = []
while k > 0:
    bin.append(k % 2)
    k //= 2
def power(x):
    global bin, module
    prod = x % module
    ans = 1
    for entry in bin:
        if entry > 0:
            ans = (ans * prod) % module
        prod = (prod ** 2) % module
    return ans
f = [1, 1]
if n > 2:
    for i in range(2, n):
        f.append((f[-1] + f[-2]) % module)
ans = 0
for i in range(n):
    ans = (ans + f[i + 1] * power(i + 1)) % module
print(ans)