# def check(g):
#     for i in range(n):
#         for j in range(m):
#             c = g[i][j]
#             # print(i,j)
#             same = 0
#             if i>0:
#                 if g[i-1][j]==c:
#                     same += 1
#             if j>0:
#                 if g[i][j-1]==c:
#                     same += 1
#             if i<n-1:
#                 if g[i+1][j]==c:
#                     same += 1
#             if j<m-1:
#                 if g[i][j+1]==c:
#                     same += 1
#             if same>1:
#                 return False
#     return True


# n,m = 3,6
# import numpy as np
# import itertools
# import copy
# for n in range(1,7):
#     for m in range(1,4):
#         K = n
#         N = m
#         ans = 0

#         x = [np.reshape(np.array(i), (K, N)) for i in itertools.product([0, 1], repeat = K*N)]
#         for i in x:

#             ab = i.tolist()
#             if check(copy.deepcopy(ab)):
#                 ans += 1

#         print(n,"*",m,"-",ans)

'''
a = [[0 for _ in range(m)] for _i in range(n)]

q = []



import copy
q.append([copy.deepcopy(a),[0,0]])
v = []
ans = 0
while len(q)>0:
    b = q.pop(0)
    aa = b[0]
    ii = b[1]
    ni = []
    if ii[0]>=n or ii[1]>=m:
        continue
    if check(aa):
        ans += 1
    
    if ii[0]==n-1:
        ni = [0,ii[1]+1]
    else:
        ni = [ii[0]+1,ii[1]]
    
    if ni[0]>=n or ni[1]>=m:
        continue

    copy1 = copy.deepcopy(aa)
    copy1[ni[0]][ni[1]] = 1
    q.append([copy1,ni])
    q.append([copy.deepcopy(aa),ni])
    
    
print(ans)
'''
md = 10**9 + 7

n,m = map(int,input().split())
if n==1 and m==1:
    print(2)
else:
    a = [0 for _ in range(max(n,m))]
    a[0] = 2%md
    a[1] = 4%md
    for i in range(2,max(n,m)):
        a[i] = (a[i-1]+a[i-2])%md


    b = [0 for _ in range(n)]
    b[0] = a[m-1]
    for i in range(1,n):
        x = 0 if i<=2 else i-2
        b[i] = (b[x]%md + a[i-1])%md

    print(b[-1])