/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <iostream>
#include <fstream>

#include "bits/stdc++.h"

#define REP(i,x,y) for(ll i=(x);i<(y);i++)
#define RREP(i,x,y) for(ll i=(ll)(y)-1;i>=(x);i--)
#define all(x) (x).begin(),(x).end()
//#define int long long

using namespace std;

// conversion
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

#define dump(x)  cout << #x << " = " << (x) << endl
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl

typedef long long ll;

const ll MOD = 1e9 + 7;

long long modPow(long long a, long long x, long long p) {
    long long res = 1;
    while(x > 0) {
        if( x % 2 != 0) {
            res = (res * a) % p;
        }
        a = (a * a) % p;
        x /= 2;
    }
    return res;
}

long long modInverse(long long a, long long p) {
    //calculates the modular multiplicative of a mod m.
    //(assuming p is prime).
    return modPow(a, p-2, p);
}

long long modFactorial(long long a, long long p) {
    long long fact = 1;
    for (long long i=2; i<=a; i++) {
        fact *= i;
        fact %= p;
    }
    return fact;
}

long long combination(long long n, long long k, long long p) {
    // calculates C(n,k) mod p (assuming p is prime).

    long long numerator = 1; // n * (n-1) * ... * (n-k+1)
    for (int i=0; i<k; i++) {
        numerator = (numerator * (n-i) ) % p;
    }

    long long denominator = 1; // k!
    for (int i=1; i<=k; i++) {
        denominator = (denominator * i) % p;
    }

    // numerator / denominator mod p.
    return ( numerator* modInverse(denominator,p) ) % p;
}


class ERoaming {
public:
    void solve(std::istream& in, std::ostream& out) {
        ll n, k;
        in >> n >> k;
        ll answer = 0;
        answer += combination(2 * n - 1, n, MOD);

        vector<ll> factorials(2 * n, 1);
        vector<ll> inverseFactorials(n+1, 1);
        REP(i,2,2 * n) {
            factorials[i] = factorials[i-1] * i;
            factorials[i] %= MOD;
        }
        inverseFactorials[n] = modPow(factorials[n], MOD-2, MOD);
        RREP(i,1,n) {
            inverseFactorials[i] = inverseFactorials[i+1] * (i+1);
            inverseFactorials[i] %= MOD;
        }
        REP(l, k+1, n) {
//            ll sub = combination(n, l, MOD);
//            sub *= combination((n - (n-l)) + (n-1 - l),(n - (n-l)), MOD);
//            sub *= combination(n-1,l, MOD);
            ll sub = factorials[n];
            sub %= MOD;
            sub *= inverseFactorials[l];
            sub %= MOD;
            sub *= inverseFactorials[n-l];
            sub %= MOD;
            sub *= factorials[n-1];
            sub %= MOD;
            sub *= inverseFactorials[l];
            sub %= MOD;
            sub *= inverseFactorials[n-l-1];
            sub %= MOD;
            answer = answer + MOD - sub;
            answer %= MOD;
        }
        out << answer << endl;
    }
};


signed main() {
    ERoaming solver;
    std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 4992