'''
    Author : thekushalghosh
    Team   : CodeDiggers
'''
import sys,math,statistics as ss,collections as cc
input = sys.stdin.readline
n,m = map(int,input().split())
a = [1] + [0] * n
for i in range(1,n + 1):
    if i > 0:
        a[i] = (a[i] + a[i - 1]) % 1000000007
        if i > 1:
            a[i] = (a[i] + a[i - 2]) % 1000000007
b = [1] + [0] * m
for i in range(1,m + 1):
    if i > 0:
        b[i] = (b[i] + b[i - 1]) % 1000000007
        if i > 1:
            b[i] = (b[i] + b[i - 2]) % 1000000007
print((2 * (a[-1] + b[-1] - 1)) % 1000000007)