n,k = map(int,input().split())
#逆元nCr
mod = 10**9+7
def cmb(n,r,mod):
    r = min(r, n-r)
    return (fact[n] * factinv[r] * factinv[n-r]) % mod
def h(n,r,mod):
    return cmb(n+r-1,r,mod)
def makefact(n,mod):
    fact = [1,1]
    factinv = [1,1]
    inv = [0,1]
    for i in range(2,n+1):
        fact.append((fact[-1]*i) % mod)
        inv.append(-inv[mod%i]*(mod//i)%mod)
        factinv.append((factinv[-1]*inv[-1])%mod)
    return fact,factinv
fact,factinv = makefact(n,mod)


ans = 0
for i in range(min(n,k+1)):
    ans = (ans+cmb(n,i,mod)*h(n-i,i,mod))%mod
print(ans) 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 cmb(n,r,mod):
    r = min(r, n-r)
    return (fact[n] * factinv[r] * factinv[n-r]) % mod cmb r = min(r, n-r) r min(r, n-r) min r n-r n r return (fact[n] * factinv[r] * factinv[n-r]) % mod (fact[n] * factinv[r] * factinv[n-r]) % mod fact[n] * factinv[r] * factinv[n-r] fact[n] * factinv[r] fact[n] fact n factinv[r] factinv r factinv[n-r] factinv n-r n r mod n n r r mod mod def h(n,r,mod):
    return cmb(n+r-1,r,mod) h return cmb(n+r-1,r,mod) cmb(n+r-1,r,mod) cmb n+r-1 n+r n r 1 r mod n n r r mod mod def makefact(n,mod):
    fact = [1,1]
    factinv = [1,1]
    inv = [0,1]
    for i in range(2,n+1):
        fact.append((fact[-1]*i) % mod)
        inv.append(-inv[mod%i]*(mod//i)%mod)
        factinv.append((factinv[-1]*inv[-1])%mod)
    return fact,factinv makefact fact = [1,1] fact [1,1] 1 1 factinv = [1,1] factinv [1,1] 1 1 inv = [0,1] inv [0,1] 0 1 for i in range(2,n+1):
        fact.append((fact[-1]*i) % mod)
        inv.append(-inv[mod%i]*(mod//i)%mod)
        factinv.append((factinv[-1]*inv[-1])%mod)
     i range(2,n+1) range 2 n+1 n 1 fact.append((fact[-1]*i) % mod) fact.append fact append (fact[-1]*i) % mod fact[-1]*i fact[-1] fact -1 i mod inv.append(-inv[mod%i]*(mod//i)%mod) inv.append inv append -inv[mod%i]*(mod//i)%mod -inv[mod%i]*(mod//i) -inv[mod%i] inv[mod%i] inv mod%i mod i mod//i mod i mod factinv.append((factinv[-1]*inv[-1])%mod) factinv.append factinv append (factinv[-1]*inv[-1])%mod factinv[-1]*inv[-1] factinv[-1] factinv -1 inv[-1] inv -1 mod return fact,factinv return fact,factinv fact factinv n n mod mod fact,factinv = makefact(n,mod) fact makefact(n,mod) makefact n mod factinv ans = 0 ans 0 for i in range(min(n,k+1)):
    ans = (ans+cmb(n,i,mod)*h(n-i,i,mod))%mod i range(min(n,k+1)) range min(n,k+1) min n k+1 k 1 ans = (ans+cmb(n,i,mod)*h(n-i,i,mod))%mod ans (ans+cmb(n,i,mod)*h(n-i,i,mod))%mod ans+cmb(n,i,mod)*h(n-i,i,mod) ans cmb(n,i,mod)*h(n-i,i,mod) cmb(n,i,mod) cmb n i mod h(n-i,i,mod) h n-i n i i mod mod print(ans) print ans n,k = map(int,input().split()) map(int,input().split()) n def cmb(n,r,mod):
    r = min(r, n-r)
    return (fact[n] * factinv[r] * factinv[n-r]) % mod def cmb(n,r,mod):
    r = min(r, n-r)
    return (fact[n] * factinv[r] * factinv[n-r]) % mod cmb def h(n,r,mod):
    return cmb(n+r-1,r,mod) def h(n,r,mod):
    return cmb(n+r-1,r,mod) h def makefact(n,mod):
    fact = [1,1]
    factinv = [1,1]
    inv = [0,1]
    for i in range(2,n+1):
        fact.append((fact[-1]*i) % mod)
        inv.append(-inv[mod%i]*(mod//i)%mod)
        factinv.append((factinv[-1]*inv[-1])%mod)
    return fact,factinv def makefact(n,mod):
    fact = [1,1]
    factinv = [1,1]
    inv = [0,1]
    for i in range(2,n+1):
        fact.append((fact[-1]*i) % mod)
        inv.append(-inv[mod%i]*(mod//i)%mod)
        factinv.append((factinv[-1]*inv[-1])%mod)
    return fact,factinv makefact fact,factinv = makefact(n,mod) makefact(n,mod) fact ans = 0 0 ans mod = 10**9+7 10**9+7 mod factinv = makefact(n,mod) makefact(n,mod) factinv ans = (ans+cmb(n,i,mod)*h(n-i,i,mod))%mod (ans+cmb(n,i,mod)*h(n-i,i,mod))%mod ans k = map(int,input().split()) map(int,input().split()) k
n,k = map(int,input().split())
#逆元nCr
mod = 10**9+7
def cmb(n,r,mod):
    r = min(r, n-r)
    return (fact[n] * factinv[r] * factinv[n-r]) % mod
def h(n,r,mod):
    return cmb(n+r-1,r,mod)
def makefact(n,mod):
    fact = [1,1]
    factinv = [1,1]
    inv = [0,1]
    for i in range(2,n+1):
        fact.append((fact[-1]*i) % mod)
        inv.append(-inv[mod%i]*(mod//i)%mod)
        factinv.append((factinv[-1]*inv[-1])%mod)
    return fact,factinv
fact,factinv = makefact(n,mod)


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