import sys
#sys.stdin = open('in', 'r')
#n = int(input())
n,m = map(int, input().split())
if n < m:
    n,m = m,n
if n == 1 and m == 1:
    print(2)
elif n == 2 and m == 2:
    print(6)
else:
    md = 1000000007
    def Fn(n):
        a,b = 1, 1
        for i in range(2, n + 1):
            a, b = (a + b) % md, a
        return a
    print((2*Fn(n)+2*Fn(m) - 2)% md)
    




#sys.stdout.write('YES\n')
#sys.stdout.write(f'{res}\n')
#sys.stdout.write(f'{y1} {x1} {y2} {x2}\n')
