#include #include using namespace std; using mint = atcoder::modint1000000007; int main(){ int n, m; cin >> n >> m; vector fact(m + 1), inv(m + 1); fact[0] = 1; for(int i = 1; i <= m; i++)fact[i] = i * fact[i - 1]; inv[m] = 1 / fact[m]; for(int i = m; i >= 1; i--)inv[i - 1] = i * inv[i]; mint ans; for(int i = n; i <= m; i++){ ans += fact[i] * inv[i - n] * inv[n]; } cout << ans.val() << '\n'; }