import sys
input = sys.stdin.readline

n, m = map(int, input().split())

if n == 1 and m == 1:
    print(2)
    exit()
    
MOD = 10**9+7
N = max(n, m)
dp = [[0] * 4 for _ in range(N+1)]

for j in range(4):
    dp[2][j] = 1

for i in range(2, N):
    dp[i+1][0] = dp[i][2]
    dp[i+1][1] = dp[i][0]+dp[i][2]
    dp[i+1][2] = dp[i][1]+dp[i][3]
    dp[i+1][3] = dp[i][1]
    
    for j in range(4):
        dp[i+1][j] %= MOD

if n == 1:
    print(sum(dp[m])%MOD)
elif m == 1:
    print(sum(dp[n])%MOD)
else:
    print((sum(dp[n])+sum(dp[m])-2)%MOD)