r, c = [int(i) for i in input().split()]

import operator as op
from functools import reduce

def ncr(n, r):
    r = min(r, n-r)
    numer = reduce(op.mul, range(n, n-r, -1), 1)
    denom = reduce(op.mul, range(1, r+1), 1)
    return numer / denom


count = 1
for t in range(1, c//2+1):
	count += ncr(c-t+1, t)
	count %= 1000000007
count *= 2
print(int(count))