N ,K = map(int, input().split())
MOD = 10**9 + 7
ans = 0

S = [0]*(2*10**5+1)
S[1] = 1
for i in range(2, 2*10**5+1):
    S[i] = S[MOD%i]*(MOD-int(MOD/i))%MOD

if N-1 <= K:
    ans = 1
    num = 2*N - 1
    for i in range(N-1):
        ans *= (num-i)*S[i+1]
        ans %= MOD
    print(ans%MOD)
else:
    S1 = [1]*N
    S2 = [1]*N
    for i in range(1, N):
        S1[i] = (S1[i-1]*(N+1-i)*S[i])%MOD
        S2[i] = (S2[i-1]*(N-i)*S[i])%MOD
    ans = 0
    for i in range(K+1):
        ans += S1[i]*S2[N-1-i]
        ans %= MOD
    print(ans)


# nCm * n-mHm
# nCm * n-1Cn-m-1 N ,K = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split K MOD = 10**9 + 7 MOD 10**9 + 7 10**9 10 9 7 ans = 0 ans 0 S = [0]*(2*10**5+1) S [0]*(2*10**5+1) [0] 0 2*10**5+1 2*10**5 2 10**5 10 5 1 S[1] = 1 S[1] S 1 1 for i in range(2, 2*10**5+1):
    S[i] = S[MOD%i]*(MOD-int(MOD/i))%MOD i range(2, 2*10**5+1) range 2 2*10**5+1 2*10**5 2 10**5 10 5 1 S[i] = S[MOD%i]*(MOD-int(MOD/i))%MOD S[i] S i S[MOD%i]*(MOD-int(MOD/i))%MOD S[MOD%i]*(MOD-int(MOD/i)) S[MOD%i] S MOD%i MOD i MOD-int(MOD/i) MOD int(MOD/i) int MOD/i MOD i MOD if N-1 <= K:
    ans = 1
    num = 2*N - 1
    for i in range(N-1):
        ans *= (num-i)*S[i+1]
        ans %= MOD
    print(ans%MOD)
else:
    S1 = [1]*N
    S2 = [1]*N
    for i in range(1, N):
        S1[i] = (S1[i-1]*(N+1-i)*S[i])%MOD
        S2[i] = (S2[i-1]*(N-i)*S[i])%MOD
    ans = 0
    for i in range(K+1):
        ans += S1[i]*S2[N-1-i]
        ans %= MOD
    print(ans)


# nCm * n-mHm
# nCm * n-1Cn-m-1 N-1 <= K N-1 N 1 K ans = 1 ans 1 num = 2*N - 1 num 2*N - 1 2*N 2 N 1 for i in range(N-1):
        ans *= (num-i)*S[i+1]
        ans %= MOD
     i range(N-1) range N-1 N 1 ans *= (num-i)*S[i+1] ans (num-i)*S[i+1] num-i num i S[i+1] S i+1 i 1 ans %= MOD ans MOD print(ans%MOD) print ans%MOD ans MOD S1 = [1]*N S1 [1]*N [1] 1 N S2 = [1]*N S2 [1]*N [1] 1 N for i in range(1, N):
        S1[i] = (S1[i-1]*(N+1-i)*S[i])%MOD
        S2[i] = (S2[i-1]*(N-i)*S[i])%MOD
     i range(1, N) range 1 N S1[i] = (S1[i-1]*(N+1-i)*S[i])%MOD S1[i] S1 i (S1[i-1]*(N+1-i)*S[i])%MOD S1[i-1]*(N+1-i)*S[i] S1[i-1]*(N+1-i) S1[i-1] S1 i-1 i 1 N+1-i N+1 N 1 i S[i] S i MOD S2[i] = (S2[i-1]*(N-i)*S[i])%MOD S2[i] S2 i (S2[i-1]*(N-i)*S[i])%MOD S2[i-1]*(N-i)*S[i] S2[i-1]*(N-i) S2[i-1] S2 i-1 i 1 N-i N i S[i] S i MOD ans = 0 ans 0 for i in range(K+1):
        ans += S1[i]*S2[N-1-i]
        ans %= MOD
     i range(K+1) range K+1 K 1 ans += S1[i]*S2[N-1-i] ans S1[i]*S2[N-1-i] S1[i] S1 i S2[N-1-i] S2 N-1-i N-1 N 1 i ans %= MOD ans MOD print(ans) print ans S2 = [1]*N [1]*N S2 K = map(int, input().split()) map(int, input().split()) K ans *= (num-i)*S[i+1] (num-i)*S[i+1] ans ans = 0 0 ans num = 2*N - 1 2*N - 1 num MOD = 10**9 + 7 10**9 + 7 MOD ans = 0 0 ans ans %= MOD MOD ans ans = 1 1 ans N ,K = map(int, input().split()) map(int, input().split()) N S1 = [1]*N [1]*N S1 ans += S1[i]*S2[N-1-i] S1[i]*S2[N-1-i] ans ans %= MOD MOD ans S = [0]*(2*10**5+1) [0]*(2*10**5+1) S
N ,K = map(int, input().split())
MOD = 10**9 + 7
ans = 0

S = [0]*(2*10**5+1)
S[1] = 1
for i in range(2, 2*10**5+1):
    S[i] = S[MOD%i]*(MOD-int(MOD/i))%MOD

if N-1 <= K:
    ans = 1
    num = 2*N - 1
    for i in range(N-1):
        ans *= (num-i)*S[i+1]
        ans %= MOD
    print(ans%MOD)
else:
    S1 = [1]*N
    S2 = [1]*N
    for i in range(1, N):
        S1[i] = (S1[i-1]*(N+1-i)*S[i])%MOD
        S2[i] = (S2[i-1]*(N-i)*S[i])%MOD
    ans = 0
    for i in range(K+1):
        ans += S1[i]*S2[N-1-i]
        ans %= MOD
    print(ans)


# nCm * n-mHm
# nCm * n-1Cn-m-1