'''input
3 6
'''
import sys
from collections import defaultdict as dd
from itertools import  permutations as pp
from itertools import combinations as cc
from collections import Counter as ccd
from random import randint as rd
from bisect import bisect_left as bl
from  heapq import heappush as hpush
from heapq import heappop as hpop
mod=10**9+7

def ri(flag=0):
	if flag==0:
		return [int(i) for i in sys.stdin.readline().split()]
	else:
		return int(sys.stdin.readline())

n , m = ri()

if n<m:
	n,m = m,n

if n==1 and m==1:
	print(2)
	sys.exit(0)


f =[1,1]

N = 10**5+10

for i in range(N):
	f.append(f[-1]+f[-2])
	f[-1]%=mod

l = [1,3]

for i in range(N):
	l.append(l[-1]+l[-2])
	l[-1]%=mod



ans = f[m-1]+l[m-1] + 3*f[n-2] +l[n-2] -2
ans = ans%mod

print(ans)