N,M=map(int,input().split()) P=1 mod=10**9+7 X=[1,1] for i in range(2,M+3): X.append(X[-1]*i%mod) print(X[M+1]*pow(X[N+1]*X[M-N],mod-2,mod)%mod)