n, m = map(int, input().split())



dp0n = 1
dp1n = 1
dp0m = 1
dp1m = 1
dpn, dpm = 2, 2
for i in range(3, n + 1):
    dp0n, dp1n, dpn = dp1n % 1000000007, dpn % 1000000007, (dpn + dp1n) % 1000000007
    

for i in range(3, m + 1):
    dp0m, dp1m, dpm = dp1m % 1000000007, dpm % 1000000007, (dpm + dp1m) % 1000000007
if n == 1:
    dpn = 1
if m == 1:
    dpm = 1
print((dpm * 2 + dpn * 2 - 2) % 1000000007)