n, m = map(int, input().split())
MOD = 1000000007
if n < m:
    n, m = m, n

dp = list()
dp.append(1)
dp.append(1)
for i in range(2, n + 1):
    dp.append((dp[i - 1] + dp[i - 2]) % MOD)

print((dp[n] + dp[m] + MOD - 1) * 2 % MOD)
