MOD=1000000007
n,m=map(int,input().split())
L=[1,2,3,5,8,14,21,34,55,89]
for i in range(n):
    t=(L[-1]+L[-2])%MOD
    L.append(t%MOD)
#print(L)
dp=[]
dp.append((L[n-1]*2)%MOD)
for i in range(2):
    t=(dp[-1]+2)%MOD
    dp.append(t%MOD)

for i in range(m):
    t1=(2*dp[-1])%MOD
    t2=dp[-3]%MOD
    t=(t1-t2)%MOD
    dp.append(t%MOD)
#print(dp)
print(dp[m-1]%MOD)
