n, m = map(int, input().split())
if n + m == 2:
    print(2)
    exit()
if n > m:
    n, m = m, n
a, b, c, d = 1, 1, 1, 1
mod = 10 ** 9 + 7
for i in range(2, m):
    a, b, c, d = c, a + c, b + d, b
    a %= mod
    b %= mod
    c %= mod
    d %= mod
print((a + b + c + d + pow(2, n, mod) - 2) % mod)