n,m=map(int,input().split())
if n==1 and m==1:
	print (2)
else:
	k1=max(n,m)
	k2=min(n,m)
	l=[2]*k1
	l[1]=4
	for i in range(2,k1):
		l[i]=(l[i-1]+l[i-2])%1000000007
	ans=l[k1-1]
	for i in range(1,k2):
		ans+=(l[i]-l[i-1])%1000000007
	print (ans%1000000007)



















































# def calc(a,b,c):
# 	root = (b**2-4*a*c)**(0.5)
# 	num = -b + (root)
# 	deno = 2*a
# 	return num/deno

# t=int(input())
# for nt in range(t):
# 	n,s=map(int,input().split())
# 	if n==1:
# 		if s==0:
# 			print (1)
# 		else:
# 			print (-1)
# 	else:
# 		if s!=0:
# 			for i in range(n-2):
# 				print (1,end=" ")
# 			print (2,end=" ")
# 			print (calc(n-1,-1*2*n,2*n-n*n*s*s))
# 		else:
# 			for i in range(n):
# 				print (1,end=" ")
# 			print ()