#Bhargey Mehta (Junior)
#DA-IICT, Gandhinagar
import sys, math, queue, collections
#sys.stdin = open('input.txt', 'r')
MOD = 10**9+7
sys.setrecursionlimit(1000000)

n, m = map(int, input().split())
N = max(n, m)+5

black_pb = [0 for i in range(N)]
white_pb = [0 for i in range(N)]
black_ok = [1 for i in range(N)]
white_ok = [1 for i in range(N)]

for i in range(2, N):
    black_ok[i] = (white_pb[i-1]+white_ok[i-1]) % MOD
    white_ok[i] = (black_pb[i-1]+black_ok[i-1]) % MOD

    black_pb[i] = black_ok[i-1]
    white_pb[i] = white_ok[i-1]

ans = (black_ok[n]+black_pb[n]+white_ok[n]+white_pb[n]) % MOD
ans = (ans+MOD-2+black_ok[m]+black_pb[m]+white_ok[m]+white_pb[m]) % MOD
print(ans)