p=1000000000+7

def ncr(n, r):
    num = den = 1
    for i in range(r):
        num = (num * (n - i)) % p
        den = (den * (i + 1)) % p
    return (num * pow(den, 
            p - 2, p)) % p
n,m=map(int, input().split())
k=n//2
ans=0
for i in range(k+1):
    ans+=2*ncr(k,i)
    ans%=p
k=m//2
for i in range(k+1):
    ans+=2*ncr(k,i)
    ans%=p
print(ans)

