'''
    Author : thekushalghosh
    Team   : CodeDiggers
'''
import sys,math
input = sys.stdin.readline
def qw(n,r): 
    return (math.factorial(n) / (math.factorial(r) * math.factorial(n - r)))
n,m = map(int,input().split())
n = max(n,m)
q = 0
for i in range(n + 1):
    q = q + (qw(n,i))
print(int(q) % 1000000007)