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