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


def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)


def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res

def com(n, r, mod):
    r = min(r, n - r)
    if r == 0:
        return 1
    res = ilist[n] * iinvlist[n-r] * iinvlist[r] % mod
    return res


mod = 10**9+7

ilist = [0]
iinvlist = [1]
tmp = 1
for i in range(1, n+1):
    tmp *= i
    tmp %= mod
    ilist.append(tmp)
    iinvlist.append(modinv(tmp, mod))

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


print(ans) n, k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod) modinv return pow(a, mod-2, mod) pow(a, mod-2, mod) pow a mod-2 mod 2 mod a a mod=10**9+7 mod 10**9+7 10**9 10 9 7 def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res combination r = min(r, n-r) r min(r, n-r) min r n-r n r res = 1 res 1 for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
     i range(r) range r res = res * (n - i) * modinv(i+1, mod) % mod res res * (n - i) * modinv(i+1, mod) % mod res * (n - i) * modinv(i+1, mod) res * (n - i) res n - i n i modinv(i+1, mod) modinv i+1 i 1 mod mod return res res n n r r mod=10**9+7 mod 10**9+7 10**9 10 9 7 def com(n, r, mod):
    r = min(r, n - r)
    if r == 0:
        return 1
    res = ilist[n] * iinvlist[n-r] * iinvlist[r] % mod
    return res com r = min(r, n - r) r min(r, n - r) min r n - r n r if r == 0:
        return 1
     r == 0 r 0 return 1 1 res = ilist[n] * iinvlist[n-r] * iinvlist[r] % mod res ilist[n] * iinvlist[n-r] * iinvlist[r] % mod ilist[n] * iinvlist[n-r] * iinvlist[r] ilist[n] * iinvlist[n-r] ilist[n] ilist n iinvlist[n-r] iinvlist n-r n r iinvlist[r] iinvlist r mod return res res n n r r mod mod mod = 10**9+7 mod 10**9+7 10**9 10 9 7 ilist = [0] ilist [0] 0 iinvlist = [1] iinvlist [1] 1 tmp = 1 tmp 1 for i in range(1, n+1):
    tmp *= i
    tmp %= mod
    ilist.append(tmp)
    iinvlist.append(modinv(tmp, mod)) i range(1, n+1) range 1 n+1 n 1 tmp *= i tmp i tmp %= mod tmp mod ilist.append(tmp) ilist.append ilist append tmp iinvlist.append(modinv(tmp, mod)) iinvlist.append iinvlist append modinv(tmp, mod) modinv tmp mod ans = 0 ans 0 k = min(n-1, k) k min(n-1, k) min n-1 n 1 k for i in range(k+1):
    tmp = com(n, i, mod)
    tmp *= com(n-1, i, mod)
    ans += tmp
    ans %= mod i range(k+1) range k+1 k 1 tmp = com(n, i, mod) tmp com(n, i, mod) com n i mod tmp *= com(n-1, i, mod) tmp com(n-1, i, mod) com n-1 n 1 i mod ans += tmp ans tmp ans %= mod ans mod print(ans) print ans tmp *= com(n-1, i, mod) com(n-1, i, mod) tmp ans += tmp tmp ans ans %= mod mod ans mod = 10**9+7 10**9+7 mod ilist = [0] [0] ilist tmp = com(n, i, mod) com(n, i, mod) tmp iinvlist = [1] [1] iinvlist n, k = map(int, input().split()) map(int, input().split()) n def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res combination k = map(int, input().split()) map(int, input().split()) k tmp *= i i tmp tmp %= mod mod tmp def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod) def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod) modinv ans = 0 0 ans k = min(n-1, k) min(n-1, k) k def com(n, r, mod):
    r = min(r, n - r)
    if r == 0:
        return 1
    res = ilist[n] * iinvlist[n-r] * iinvlist[r] % mod
    return res def com(n, r, mod):
    r = min(r, n - r)
    if r == 0:
        return 1
    res = ilist[n] * iinvlist[n-r] * iinvlist[r] % mod
    return res com tmp = 1 1 tmp
n, k = map(int, input().split())


def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)


def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res

def com(n, r, mod):
    r = min(r, n - r)
    if r == 0:
        return 1
    res = ilist[n] * iinvlist[n-r] * iinvlist[r] % mod
    return res


mod = 10**9+7

ilist = [0]
iinvlist = [1]
tmp = 1
for i in range(1, n+1):
    tmp *= i
    tmp %= mod
    ilist.append(tmp)
    iinvlist.append(modinv(tmp, mod))

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


print(ans)