def patate(l):
	n = lst[0]
	m = lst[1]
	resultat = (fibo(n) + fibo(m) - 1)*2
	print(resultat % 1000000007)

def fibo(n):
	if n == 0:
		return(1)
	if n == 1:
		return(1)
	if n % 2 == 0:
		return(fibo(n/2)**2 + fibo(n/2 -1)**2)
	a = fibo((n-1)/2)
	b = fibo((n-1)/2 -1)
	return(a*(2*b + a))


if __name__ == '__main__':
	lst = list(map(int, input().split()))
	patate(lst)