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:
        m2, m1 = m1, (m2 + m1) % mod
doubles = m1
m1 = 4
m2 = 2
for col in range(m):
    if col < 2:
        pass
    else:
        m2, m1 = m1, (m2 + m1) % mod
        #print(m1)
singles = m1
#print(singles, doubles)
print((doubles + singles)%mod)
