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