/* -*- coding: utf-8 -*- * * 1126.cc: No.1126 SUM - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ const int MOD = 1000000007; /* typedef */ typedef long long ll; /* global variables */ /* subroutines */ int powmod(int a, int n) { // a^n % MOD int pm = 1; while (n > 0) { if (n & 1) pm = (ll)pm * a % MOD; a = (ll)a * a % MOD; n >>= 1; } return pm; } /* main */ int main() { int n, m; scanf("%d%d", &n, &m); int sum = 1, c = 1; for (int i = n + 1; i <= m; i++) { c = (ll)c * i % MOD * powmod(i - n, MOD - 2) % MOD; sum = (sum + c) % MOD; } printf("%d\n", sum); return 0; }