#include using namespace std; const long long MOD = 1000000007; long long fac[200010]; long long inv[200010]; long long finv[200010]; void init(){ fac[0] = fac[1] = 1; inv[0] = inv[1] = 1; finv[0] = finv[1] = 1; for(int i = 2; 200001 > i; i++){ fac[i] = (fac[i-1]*i)%MOD; inv[i] = MOD-((inv[MOD%i]*(MOD/i))%MOD); finv[i] = (finv[i-1]*inv[i])%MOD; } } int main(){ init(); int n,m;cin>>n>>m; long long ans = 0; for(long long i = n; m >= i; i++){ ans = (ans+fac[i]*finv[i-n])%MOD; } cout << (ans*finv[n])%MOD << endl; }