mod = 1000000007
n, m = [int(x) for x in input().split()]
m1 = 4
m2 = 2
for x in range(n):
    if x <= 2:
        pass
    else:
        tmp = (m2 + m1) % mod
        m2 = m1
        m1 = tmp
doubles = m1
m1 = 4
m2 = 2
for col in range(m):
    if col <= 2:
        pass
    else:
        tmp = (m2 + m1) % mod
        m2 = m1
        m1 = tmp
singles = m1
print((doubles+ singles)%mod)
