#include <bits/stdc++.h>
using namespace std;

using ll = long long;
const ll MOD = 1000000007LL;

ll powmod(ll a, ll b, ll mod) {
    ll res = 1;
    while (b > 0) {
        if (b % 2 == 1) {
            res = res * a % mod;
        }
        a = a * a % mod;
        b /= 2;
    }
    return res;
}

int main() {
    ll x, y;
    cin >> x >> y;
    ll n = x + 1;
    if (y > n) {
        cout << 0 << endl;
        return 0;
    }
    vector<ll> fact(n + 1, 1);
    for (ll i = 1; i <= n; ++i) {
        fact[i] = fact[i - 1] * i % MOD;
    }
    ll inv_fact_y = powmod(fact[y], MOD - 2, MOD);
    ll inv_fact_n_minus_y = powmod(fact[n - y], MOD - 2, MOD);
    ll C = fact[n] * inv_fact_y % MOD * inv_fact_n_minus_y % MOD;
    cout << C << endl;
}
