n, m = map(int, raw_input().strip().split())

N = max(n, m)

from collections import defaultdict

dp = defaultdict(lambda: 1)

dp[(0, 0)] = 1
dp[(0, 1)] = 1
dp[(1, 1)] = 1
dp[(1, 0)] = 1

dp[0] = 1
dp[1] = 2

MOD = 10**9 + 7

for i in xrange(2, N + 1):
	dp[(i, 0)] = (dp[(i - 1, 1)] + dp[(i - 2, 1)]) % MOD
	dp[(i, 1)] = (dp[(i - 1, 0)] + dp[(i - 2, 0)]) % MOD
	dp[i] = (dp[(i, 0)] + dp[(i, 1)]) % MOD
# print dp
ans = 0
ans += ((dp[m] + MOD) - 2) % MOD
ans += dp[n]
print ans % MOD
