import math
MOD = 10e9 + 7
n, m = map(int, input().split())

x = max(n, m) // 2 + 1
dp = [0] * x
dp[0] = 2

for i in range(1, x):
    j = x - 2*i
    tmp = (2 * math.factorial(i+j) / (math.factorial(i) * math.factorial(j))) % MOD
    dp[i] = (dp[i-1] + tmp) % MOD

ans = dp[n//2] + dp[m//2]
print(int(ans))
