mod = 10**9 + 7
n, m = map(int, input().split())
a1, b1 = 0, 2
for h in range(n):
	a1, b1 = b1, (a1+b1)%mod
ans1 = b1
a1, b1 = 0, 2
for h in range(m):
	ans1 = (ans1 + a1)%mod
	a1, b1 = b1, (a1+b1)%mod
print(ans1)