n, m = map(int, input().split())
mod = 10**9 + 7
if n == 1 and m == 1:
	print(2)

if (n == 1 and m == 2) or (m == 1 and n == 2):
	print(4)

if n == 2 and m == 2:
	print(6)

add1 = 2
add2 = 4
add = [add1, add2]
for i in range(1, 200000):
	add += [(add[i]+ add[i-1])%mod]

# print(add[:20])

n1 = 2
n2 = 4
n -= 2

for i in range(n):
	nxt = n1+n2
	nxt %= mod
	n1 = n2
	n2 = nxt

# print(n2)

m1 = n2+2

m -= 2

for i in range(m):
	m1 = (m1+add[i])%mod
	# print(m1)


print(m1%mod)