import sys
sys.setrecursionlimit(10**9)
d = {}
d[1] = 2
d[2] = 4
mod = pow(10,9) + 7
def cal(n):
	try:
		return d[n]
	except:
		pass
	if n < 1:
		return 0
	if (n == 1):
		return 2
	for i in range(3,n+1):
		d[i] = (d[i-1] + d[i-2])%mod
	return d[n]




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

if n == 1 and m == 1:
	print 2
	exit()
if n == 1:
	print cal(m)%mod
	exit()
if m == 1:
	print cal(n)%mod
	exit()

print (cal(n) + cal(m) - 2)%(mod)