from math import *

mod = 10**9 + 7

n, m = map(int, input().split())

x = max(n, m) + 1
dp = [0] * (x + 1)
dp[1] = 1
for i in range(2, x + 1):
    dp[i] = (dp[i-1] + dp[i-2]) % mod

#print(dp)
def solve(x):
    if x > 1:
        #print(x)
        return dp[x + 1] - 1
    else:
        return 0
    
print((2*(solve(n) + solve(m) + 1)) % mod)
