MOD = 10**9 + 7
MOD_t_MAX = 2*(10**5)+1

fac  = [None] * MOD_t_MAX
finv = [None] * MOD_t_MAX
inv  = [None] * MOD_t_MAX
def MOD_COM_init():
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, MOD_t_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
def MOD_COM(n, k):
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD
def MOD_pow(a, n):
    res = 1
    while n > 0:
        if (n & 1):
            res = res * a % MOD
        a = a * a % MOD
        n = n // 2
    return res

def main():
    n, k = map(int, input().split())
    MOD_COM_init()
    ans = 0
    for i in range(n):
        if k-i < 0:
            continue
        x = MOD_COM(n, i) * MOD_COM(n-1, n-i-1) % MOD
        ans += x
        ans %= MOD
    print(ans)
if __name__ == "__main__":
    main() MOD = 10**9 + 7 MOD 10**9 + 7 10**9 10 9 7 MOD_t_MAX = 2*(10**5)+1 MOD_t_MAX 2*(10**5)+1 2*(10**5) 2 10**5 10 5 1 fac  = [None] * MOD_t_MAX fac [None] * MOD_t_MAX [None] None MOD_t_MAX finv = [None] * MOD_t_MAX finv [None] * MOD_t_MAX [None] None MOD_t_MAX inv  = [None] * MOD_t_MAX inv [None] * MOD_t_MAX [None] None MOD_t_MAX def MOD_COM_init():
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, MOD_t_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 MOD_COM_init 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, MOD_t_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, MOD_t_MAX) range 2 MOD_t_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 def MOD_COM(n, k):
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD MOD_COM if n < k:
        return 0
     n < k n k return 0 0 if n < 0 or k < 0:
        return 0
     n < 0 or k < 0 n < 0 n 0 k < 0 k 0 return 0 0 return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD fac[n] * (finv[k] * finv[n - k] % MOD) % MOD fac[n] * (finv[k] * finv[n - k] % MOD) fac[n] fac n finv[k] * finv[n - k] % MOD finv[k] * finv[n - k] finv[k] finv k finv[n - k] finv n - k n k MOD MOD n n k k def MOD_pow(a, n):
    res = 1
    while n > 0:
        if (n & 1):
            res = res * a % MOD
        a = a * a % MOD
        n = n // 2
    return res MOD_pow res = 1 res 1 while n > 0:
        if (n & 1):
            res = res * a % MOD
        a = a * a % MOD
        n = n // 2
     n > 0 n 0 if (n & 1):
            res = res * a % MOD
         n & 1 n 1 res = res * a % MOD res res * a % MOD res * a res a MOD a = a * a % MOD a a * a % MOD a * a a a MOD n = n // 2 n n // 2 n 2 return res res a a n n def main():
    n, k = map(int, input().split())
    MOD_COM_init()
    ans = 0
    for i in range(n):
        if k-i < 0:
            continue
        x = MOD_COM(n, i) * MOD_COM(n-1, n-i-1) % MOD
        ans += x
        ans %= MOD
    print(ans) main n, k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k MOD_COM_init() MOD_COM_init ans = 0 ans 0 for i in range(n):
        if k-i < 0:
            continue
        x = MOD_COM(n, i) * MOD_COM(n-1, n-i-1) % MOD
        ans += x
        ans %= MOD
     i range(n) range n if k-i < 0:
            continue
         k-i < 0 k-i k i 0 continue x = MOD_COM(n, i) * MOD_COM(n-1, n-i-1) % MOD x MOD_COM(n, i) * MOD_COM(n-1, n-i-1) % MOD MOD_COM(n, i) * MOD_COM(n-1, n-i-1) MOD_COM(n, i) MOD_COM n i MOD_COM(n-1, n-i-1) MOD_COM n-1 n 1 n-i-1 n-i n i 1 MOD ans += x ans x ans %= MOD ans MOD print(ans) print ans if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main MOD_t_MAX = 2*(10**5)+1 2*(10**5)+1 MOD_t_MAX def MOD_COM_init():
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, MOD_t_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 def MOD_COM_init():
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, MOD_t_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 MOD_COM_init MOD = 10**9 + 7 10**9 + 7 MOD def MOD_pow(a, n):
    res = 1
    while n > 0:
        if (n & 1):
            res = res * a % MOD
        a = a * a % MOD
        n = n // 2
    return res def MOD_pow(a, n):
    res = 1
    while n > 0:
        if (n & 1):
            res = res * a % MOD
        a = a * a % MOD
        n = n // 2
    return res MOD_pow def MOD_COM(n, k):
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD def MOD_COM(n, k):
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD MOD_COM fac  = [None] * MOD_t_MAX [None] * MOD_t_MAX fac finv = [None] * MOD_t_MAX [None] * MOD_t_MAX finv inv  = [None] * MOD_t_MAX [None] * MOD_t_MAX inv def main():
    n, k = map(int, input().split())
    MOD_COM_init()
    ans = 0
    for i in range(n):
        if k-i < 0:
            continue
        x = MOD_COM(n, i) * MOD_COM(n-1, n-i-1) % MOD
        ans += x
        ans %= MOD
    print(ans) def main():
    n, k = map(int, input().split())
    MOD_COM_init()
    ans = 0
    for i in range(n):
        if k-i < 0:
            continue
        x = MOD_COM(n, i) * MOD_COM(n-1, n-i-1) % MOD
        ans += x
        ans %= MOD
    print(ans) main
MOD = 10**9 + 7
MOD_t_MAX = 2*(10**5)+1

fac  = [None] * MOD_t_MAX
finv = [None] * MOD_t_MAX
inv  = [None] * MOD_t_MAX
def MOD_COM_init():
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, MOD_t_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
def MOD_COM(n, k):
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD
def MOD_pow(a, n):
    res = 1
    while n > 0:
        if (n & 1):
            res = res * a % MOD
        a = a * a % MOD
        n = n // 2
    return res

def main():
    n, k = map(int, input().split())
    MOD_COM_init()
    ans = 0
    for i in range(n):
        if k-i < 0:
            continue
        x = MOD_COM(n, i) * MOD_COM(n-1, n-i-1) % MOD
        ans += x
        ans %= MOD
    print(ans)
if __name__ == "__main__":
    main()