n, k = map(int, input().split())

mod = 10 ** 9 + 7 # (modの値をすごく大きくすれば（5乗とか）、普通のnCrとして使える)
MAX = 2 * (10 ** 5) + 1 # これは変動するので注意。せいぜい10 ** 6くらいまでがTLEの限界

def com_init(MAX, mod):
    fac = [0] * MAX
    finv = [0] * MAX
    inv = [0] * MAX
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, MAX):
        fac[i] = fac[i - 1] * i % mod
        inv[i] = mod - inv[mod % i] * (mod // i) % mod
        finv[i] = finv[i - 1] * inv[i] % mod
    return fac, finv

fac, finv = com_init(MAX, mod)

def nCr(n, r):
    if n < r:
        return 0
    elif n < 0 or r < 0:
        return 0
    return fac[n] * (finv[r] * finv[n - r] % mod) % mod

def nHk(n, k):
    '''
    Duplicated Combination
    '''
    return nCr(n - 1 + k, n - 1)

ans = 0
for i in range(min(n, k + 1)):
    ans += nCr(n, i) * nCr(n - 1, n - i - 1) % mod
print(ans % mod) 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 MAX = 2 * (10 ** 5) + 1 MAX 2 * (10 ** 5) + 1 2 * (10 ** 5) 2 10 ** 5 10 5 1 def com_init(MAX, mod):
    fac = [0] * MAX
    finv = [0] * MAX
    inv = [0] * MAX
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, MAX):
        fac[i] = fac[i - 1] * i % mod
        inv[i] = mod - inv[mod % i] * (mod // i) % mod
        finv[i] = finv[i - 1] * inv[i] % mod
    return fac, finv com_init fac = [0] * MAX fac [0] * MAX [0] 0 MAX finv = [0] * MAX finv [0] * MAX [0] 0 MAX inv = [0] * MAX inv [0] * MAX [0] 0 MAX fac[0] = fac[1] = 1 fac[0] fac 0 1 = fac[1] = 1 fac[1] fac 1 1 finv[0] = finv[1] = 1 finv[0] finv 0 1 = finv[1] = 1 finv[1] finv 1 1 inv[1] = 1 inv[1] inv 1 1 for i in range(2, MAX):
        fac[i] = fac[i - 1] * i % mod
        inv[i] = mod - inv[mod % i] * (mod // i) % mod
        finv[i] = finv[i - 1] * inv[i] % mod
     i range(2, MAX) range 2 MAX fac[i] = fac[i - 1] * i % mod fac[i] fac i fac[i - 1] * i % mod fac[i - 1] * i fac[i - 1] fac i - 1 i 1 i mod inv[i] = mod - inv[mod % i] * (mod // i) % mod inv[i] inv i mod - inv[mod % i] * (mod // i) % mod mod inv[mod % i] * (mod // i) % mod inv[mod % i] * (mod // i) inv[mod % i] inv mod % i mod i mod // i mod i mod finv[i] = finv[i - 1] * inv[i] % mod finv[i] finv i finv[i - 1] * inv[i] % mod finv[i - 1] * inv[i] finv[i - 1] finv i - 1 i 1 inv[i] inv i mod return fac, finv return fac, finv fac finv MAX MAX mod mod fac, finv = com_init(MAX, mod) fac com_init(MAX, mod) com_init MAX mod finv def nCr(n, r):
    if n < r:
        return 0
    elif n < 0 or r < 0:
        return 0
    return fac[n] * (finv[r] * finv[n - r] % mod) % mod nCr if n < r:
        return 0
    elif n < 0 or r < 0:
        return 0
     n < r n r return 0 0 elif n < 0 or r < 0:
        return 0
     n < 0 or r < 0 n < 0 n 0 r < 0 r 0 return 0 0 return fac[n] * (finv[r] * finv[n - r] % mod) % mod fac[n] * (finv[r] * finv[n - r] % mod) % mod fac[n] * (finv[r] * finv[n - r] % mod) fac[n] fac n finv[r] * finv[n - r] % mod finv[r] * finv[n - r] finv[r] finv r finv[n - r] finv n - r n r mod mod n n r r def nHk(n, k):
    '''
    Duplicated Combination
    '''
    return nCr(n - 1 + k, n - 1) nHk '''
    Duplicated Combination
    ''' return nCr(n - 1 + k, n - 1) nCr(n - 1 + k, n - 1) nCr n - 1 + k n - 1 n 1 k n - 1 n 1 n n k k ans = 0 ans 0 for i in range(min(n, k + 1)):
    ans += nCr(n, i) * nCr(n - 1, n - i - 1) % mod i range(min(n, k + 1)) range min(n, k + 1) min n k + 1 k 1 ans += nCr(n, i) * nCr(n - 1, n - i - 1) % mod ans nCr(n, i) * nCr(n - 1, n - i - 1) % mod nCr(n, i) * nCr(n - 1, n - i - 1) nCr(n, i) nCr n i nCr(n - 1, n - i - 1) nCr n - 1 n 1 n - i - 1 n - i n i 1 mod print(ans % mod) print ans % mod ans mod def nHk(n, k):
    '''
    Duplicated Combination
    '''
    return nCr(n - 1 + k, n - 1) def nHk(n, k):
    '''
    Duplicated Combination
    '''
    return nCr(n - 1 + k, n - 1) nHk ans = 0 0 ans k = map(int, input().split()) map(int, input().split()) k fac, finv = com_init(MAX, mod) com_init(MAX, mod) fac finv = com_init(MAX, mod) com_init(MAX, mod) finv ans += nCr(n, i) * nCr(n - 1, n - i - 1) % mod nCr(n, i) * nCr(n - 1, n - i - 1) % mod ans mod = 10 ** 9 + 7 10 ** 9 + 7 mod def nCr(n, r):
    if n < r:
        return 0
    elif n < 0 or r < 0:
        return 0
    return fac[n] * (finv[r] * finv[n - r] % mod) % mod def nCr(n, r):
    if n < r:
        return 0
    elif n < 0 or r < 0:
        return 0
    return fac[n] * (finv[r] * finv[n - r] % mod) % mod nCr MAX = 2 * (10 ** 5) + 1 2 * (10 ** 5) + 1 MAX n, k = map(int, input().split()) map(int, input().split()) n def com_init(MAX, mod):
    fac = [0] * MAX
    finv = [0] * MAX
    inv = [0] * MAX
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, MAX):
        fac[i] = fac[i - 1] * i % mod
        inv[i] = mod - inv[mod % i] * (mod // i) % mod
        finv[i] = finv[i - 1] * inv[i] % mod
    return fac, finv def com_init(MAX, mod):
    fac = [0] * MAX
    finv = [0] * MAX
    inv = [0] * MAX
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, MAX):
        fac[i] = fac[i - 1] * i % mod
        inv[i] = mod - inv[mod % i] * (mod // i) % mod
        finv[i] = finv[i - 1] * inv[i] % mod
    return fac, finv com_init
n, k = map(int, input().split())

mod = 10 ** 9 + 7 # (modの値をすごく大きくすれば（5乗とか）、普通のnCrとして使える)
MAX = 2 * (10 ** 5) + 1 # これは変動するので注意。せいぜい10 ** 6くらいまでがTLEの限界

def com_init(MAX, mod):
    fac = [0] * MAX
    finv = [0] * MAX
    inv = [0] * MAX
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, MAX):
        fac[i] = fac[i - 1] * i % mod
        inv[i] = mod - inv[mod % i] * (mod // i) % mod
        finv[i] = finv[i - 1] * inv[i] % mod
    return fac, finv

fac, finv = com_init(MAX, mod)

def nCr(n, r):
    if n < r:
        return 0
    elif n < 0 or r < 0:
        return 0
    return fac[n] * (finv[r] * finv[n - r] % mod) % mod

def nHk(n, k):
    '''
    Duplicated Combination
    '''
    return nCr(n - 1 + k, n - 1)

ans = 0
for i in range(min(n, k + 1)):
    ans += nCr(n, i) * nCr(n - 1, n - i - 1) % mod
print(ans % mod)