m ,n =  map(int,input().split())
t_1 = 2
t_2 = 4
if m >=3:
    for numbers in range(3,m+1):
        t_2_copy = t_2
        t_2 = t_2 + t_1
        t_1 = t_2_copy
x_1 = 2
x_2 = 4
if n >= 3:
    for numbers in range(3,n+1):
        x_2_copy = x_2
        x_2 = x_2 + x_1
        x_1 = x_2_copy
if m >=2 and n >= 2 :        
    print((t_2 + x_2 -2 )%(10**9 +7))
elif m == 1 and n != 1:
    print((t_1 + x_2 -2 )%(10**9 +7))
elif n == 1 and m != 1 :
    print((t_2 + x_1 -2 )%(10**9 +7))
else :
    print(2)
    