mod = 10**9 + 7

n, m = map(int, raw_input().strip().split())
if n > m:
    n, m = m, n

a = [1 for i in range(n + m + n + m + 5)]
a[0] = 0
for i in range(n + 1, n + m + n + m + 1):
    a[i] = a[i - 1] + a[i - (n + 1)]
    a[i] %= mod
print (2 * a[n + n + m - 1]) % mod
