def read_int():
    return int(input())

def read_str():
    return input().strip()

def solve(n, m):
    mod = 10**9 + 7
    k = max(n, m) + 1
    count_1 = [0] * k
    count_2 = [0] * k
    count_1[1] = 1
    count_2[1] = 0
    for i in range(2, k):
        count_1[i] = (count_1[i - 1] + count_2[i - 1]) % mod
        count_2[i] = count_1[i - 1]

    return (2 * (count_1[n] + count_2[n] + count_1[m] + count_2[m] - 1 + mod)) % mod

n, m = map(int, read_str().split())
res = solve(n, m)
print("%s" % res)