n, m = map(int, input().split())
if n < m:
    n, m = m, n
if n == 1:
    print(2)
    exit()

mod = 10**9 + 7
dp = [2] + [0]*(n+10)
for i in range(n-1):
    dp[i] %= mod
    dp[i+1] += dp[i]
    dp[i+2] += dp[i]

ans = (dp[n-2] + dp[n-1] - 2) % mod
if m == 1:
    print((ans + 2) % mod)
    exit()

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

ans += dp[m-2] + dp[m-1]
ans %= mod
print(ans)
