from math import* f=factorial n,m=map(int,input().split()) print(f(m+1)//f(m-n)//f(n+1)%(10**9+7))