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