import os
import sys
from collections import defaultdict as ddic, Counter, deque
from itertools import combinations, permutations, product
import bisect, heapq

FAST_INPUT = 0
if FAST_INPUT:
    from atexit import register
    from io import BytesIO
 
    sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size))
    sys.stdout = BytesIO()
    register(lambda: os.write(1, sys.stdout.getvalue()))
 
rr = lambda: sys.stdin.readline().rstrip('\r\n')
rri = lambda: int(rr())
rrm = lambda: map(int, rr().split())
MOD = 10**9 + 7
 
DEBUG = 0
if DEBUG:
    import random
    random.seed(0)
    ri = random.randint

#####
def solve(R, C):
    if R > C: return solve(C, R)
    A = [0, 2, 4]
    while len(A) <= C:
        A.append( (A[-1] + A[-2]) % MOD )
    return (A[R-1] + A[C])%MOD
        
    
ans = solve(*rrm())
print ans
























