n,k = map(int,input().split())
mod = 10**9+7
def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

fac = [0]*(n+1)
fac[0] = 1
fac[1] = 1
for i in range(2,n+1):
    fac[i] = fac[i-1] * i % mod

def combi(n,r,mod=10**9+7):
    return( ( fac[n] * modinv(fac[r]) )%mod * modinv(fac[n-r]) % mod)

ans = 0
for i in range(min(k+1,n)):
    ans += combi(n,i)*combi(n-1,n-i-1) % mod
    ans %= 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 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 fac = [0]*(n+1) fac [0]*(n+1) [0] 0 n+1 n 1 fac[0] = 1 fac[0] fac 0 1 fac[1] = 1 fac[1] fac 1 1 for i in range(2,n+1):
    fac[i] = fac[i-1] * i % mod i range(2,n+1) range 2 n+1 n 1 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 def combi(n,r,mod=10**9+7):
    return( ( fac[n] * modinv(fac[r]) )%mod * modinv(fac[n-r]) % mod) combi return( ( fac[n] * modinv(fac[r]) )%mod * modinv(fac[n-r]) % mod) ( fac[n] * modinv(fac[r]) )%mod * modinv(fac[n-r]) % mod ( fac[n] * modinv(fac[r]) )%mod * modinv(fac[n-r]) ( fac[n] * modinv(fac[r]) )%mod fac[n] * modinv(fac[r]) fac[n] fac n modinv(fac[r]) modinv fac[r] fac r mod modinv(fac[n-r]) modinv fac[n-r] fac n-r n r mod n n r r mod=10**9+7 mod 10**9+7 10**9 10 9 7 ans = 0 ans 0 for i in range(min(k+1,n)):
    ans += combi(n,i)*combi(n-1,n-i-1) % mod
    ans %= mod i range(min(k+1,n)) range min(k+1,n) min k+1 k 1 n ans += combi(n,i)*combi(n-1,n-i-1) % mod ans combi(n,i)*combi(n-1,n-i-1) % mod combi(n,i)*combi(n-1,n-i-1) combi(n,i) combi n i combi(n-1,n-i-1) combi n-1 n 1 n-i-1 n-i n i 1 mod ans %= mod ans mod print(ans % mod) print ans % mod ans mod ans += combi(n,i)*combi(n-1,n-i-1) % mod combi(n,i)*combi(n-1,n-i-1) % mod ans fac = [0]*(n+1) [0]*(n+1) fac n,k = map(int,input().split()) map(int,input().split()) n ans = 0 0 ans ans %= mod mod ans 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 k = map(int,input().split()) map(int,input().split()) k mod = 10**9+7 10**9+7 mod def combi(n,r,mod=10**9+7):
    return( ( fac[n] * modinv(fac[r]) )%mod * modinv(fac[n-r]) % mod) def combi(n,r,mod=10**9+7):
    return( ( fac[n] * modinv(fac[r]) )%mod * modinv(fac[n-r]) % mod) combi
n,k = map(int,input().split())
mod = 10**9+7
def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

fac = [0]*(n+1)
fac[0] = 1
fac[1] = 1
for i in range(2,n+1):
    fac[i] = fac[i-1] * i % mod

def combi(n,r,mod=10**9+7):
    return( ( fac[n] * modinv(fac[r]) )%mod * modinv(fac[n-r]) % mod)

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