n,m=map(int,input().split()) mod=10**9+7 ans=0 f=1 for i in range(n,m+1): ans+=f f*=i+1 f*=pow(i-n+1,mod-2,mod) f%=mod print(ans)