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 brute(R, C):
    def neighbors(r, c):
        for nr,nc in((r-1,c),(r+1,c),(r,c-1),(r,c+1)):
            if 0<=nr<R and 0<=nc<C:
                yield nr, nc

    ans = 0
    for cand in product(range(2),repeat = R*C):
        
        A = [[0] * C for _ in xrange(R)]
        for i, v in enumerate(cand):
            A[i/C][i%C] = v

        bad = False
        for r, row in enumerate(A):
            for c, val in enumerate(row):
                common = 0
                for nr, nc in neighbors(r, c):
                    common += val == A[nr][nc]
                if common > 1:
                    bad = True
                    break
            if bad: break
        if not bad:
            ans += 1
    return ans
"""  

def solve(R, C):
    if R > C: return solve(C, R)
    A = [0, 2, 4]
    while len(A) <= 1 + max(R, C):
        A.append( (A[-1] + A[-2]) % MOD )
    B = [0, 2, 4]
    for i in xrange(2, len(A)):
        B.append( (B[-1] + A[i]) % MOD)
    
    ans = A[C]
    ans += B[R-1]
    ans %= MOD
    return ans
        
"""
for R in xrange(1, 7):
    
    for C in xrange(1, 7):
        print R, C, brute(R, C)
        b = brute(R, C)
        if b != solve(R, C):
            print '!', R, C, b, solve(R, C)
print 'done'
"""
ans = solve(*rrm())
print ans
























