from math import *
from collections import *
import sys
input=sys.stdin.readline
n,m=map(int,input().split())
a=[2,4]
for i in range(3,max(n,m)+1):
    a.append(a[-1]+a[-2])
p=1000000007
print((a[n-1]+a[m-1]-2)%p)
