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