def mi():
        return map(int, input().split())
mod = 10**9+7
'''
2 3
10
()()())(()
'''
'''
n = int(input())
a = list(input())

dp = [[0]*n for i in range(n)]

for i in range(n):
    for j in range(i+1, n):
        t = 0
        f = False
        temp=0
        for k in range(i,j+1):
            if a[k]=='(':
                t+=1
            else:
                t-=1
            if t<0:
                f = True
            elif t==0:
                temp+=1
        if not f:

        if a[i]



'''
n,m = mi()
a = 0
b = 2
n,m = min(m,n),max(m,n)
for i in range(m):
    c = a+b
    a = b
    b = c
b-=2
b+=pow(2,n,mod)
b%=mod
print (b)
