n,k=map(int, input().split())  
MOD=10**9+7
uplimit=2*10**5+1
fac = [0 for i in range(uplimit)] # 階乗
inv = [0 for i in range(uplimit)] # iの逆元 
finv = [0 for i in range(uplimit)] # i!の逆元

def fac_and_inv() :
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, uplimit) :
        fac[i] = fac[i-1] * i % MOD
        inv[i] = MOD - inv[MOD%i] * int(MOD / i) % MOD
        finv[i] = finv[i-1] * inv[i] % MOD
    return fac, finv, inv

temp = fac_and_inv()
ans = 0

#  x : 0人部屋の数
for x in range(0, k+1) : # k回動ける=最大kまで0人部屋になりうる
    if(x >= n) : # kがn以上の場合を想定。これ以降は計算する意味なし。
        break
    y = n - x # y : 人がいる部屋の数
    ans += (fac[n]*finv[x]*finv[n-x]) * (fac[n-1] * finv[x] * finv[y-1]) % MOD
    # 要はnCx * n-xHx 通り
    # nCxは0人部屋の選び方
    # n-xHxは n-xから重複を許してx選ぶ組み合わせ
    # n-xHx = n-1Cn-x-1 = n-1Cy-1
    # よって(n-1)! / x! / (y-1)!が欲しい

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 uplimit=2*10**5+1 uplimit 2*10**5+1 2*10**5 2 10**5 10 5 1 0 for i in range(uplimit) for i in range(uplimit) i range(uplimit) range uplimit for i in range(uplimit) 0 fac = [0 for i in range(uplimit)] fac [0 for i in range(uplimit)] 0 for i in range(uplimit) for i in range(uplimit) i range(uplimit) range uplimit for i in range(uplimit) 0 inv = [0 for i in range(uplimit)] inv [0 for i in range(uplimit)] 0 for i in range(uplimit) for i in range(uplimit) i range(uplimit) range uplimit for i in range(uplimit) 0 finv = [0 for i in range(uplimit)] finv [0 for i in range(uplimit)] def fac_and_inv() :
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, uplimit) :
        fac[i] = fac[i-1] * i % MOD
        inv[i] = MOD - inv[MOD%i] * int(MOD / i) % MOD
        finv[i] = finv[i-1] * inv[i] % MOD
    return fac, finv, inv fac_and_inv 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, uplimit) :
        fac[i] = fac[i-1] * i % MOD
        inv[i] = MOD - inv[MOD%i] * int(MOD / i) % MOD
        finv[i] = finv[i-1] * inv[i] % MOD
     i range(2, uplimit) range 2 uplimit 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] * int(MOD / i) % MOD inv[i] inv i MOD - inv[MOD%i] * int(MOD / i) % MOD MOD inv[MOD%i] * int(MOD / i) % MOD inv[MOD%i] * int(MOD / i) inv[MOD%i] inv MOD%i MOD i int(MOD / i) int 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, inv return fac, finv, inv fac finv inv temp = fac_and_inv() temp fac_and_inv() fac_and_inv ans = 0 ans 0 for x in range(0, k+1) : # k回動ける=最大kまで0人部屋になりうる
    if(x >= n) : # kがn以上の場合を想定。これ以降は計算する意味なし。
        break
    y = n - x # y : 人がいる部屋の数
    ans += (fac[n]*finv[x]*finv[n-x]) * (fac[n-1] * finv[x] * finv[y-1]) % MOD
    # 要はnCx * n-xHx 通り
    # nCxは0人部屋の選び方
    # n-xHxは n-xから重複を許してx選ぶ組み合わせ
    # n-xHx = n-1Cn-x-1 = n-1Cy-1
    # よって(n-1)! / x! / (y-1)!が欲しい x range(0, k+1) range 0 k+1 k 1 if(x >= n) : # kがn以上の場合を想定。これ以降は計算する意味なし。
        break
     x >= n x n break y = n - x y n - x n x ans += (fac[n]*finv[x]*finv[n-x]) * (fac[n-1] * finv[x] * finv[y-1]) % MOD ans (fac[n]*finv[x]*finv[n-x]) * (fac[n-1] * finv[x] * finv[y-1]) % MOD (fac[n]*finv[x]*finv[n-x]) * (fac[n-1] * finv[x] * finv[y-1]) fac[n]*finv[x]*finv[n-x] fac[n]*finv[x] fac[n] fac n finv[x] finv x finv[n-x] finv n-x n x fac[n-1] * finv[x] * finv[y-1] fac[n-1] * finv[x] fac[n-1] fac n-1 n 1 finv[x] finv x finv[y-1] finv y-1 y 1 MOD print(ans % MOD) print ans % MOD ans MOD ans += (fac[n]*finv[x]*finv[n-x]) * (fac[n-1] * finv[x] * finv[y-1]) % MOD (fac[n]*finv[x]*finv[n-x]) * (fac[n-1] * finv[x] * finv[y-1]) % MOD ans uplimit=2*10**5+1 2*10**5+1 uplimit y = n - x n - x y fac = [0 for i in range(uplimit)] [0 for i in range(uplimit)] fac inv = [0 for i in range(uplimit)] [0 for i in range(uplimit)] inv ans = 0 0 ans n,k=map(int, input().split()) map(int, input().split()) n k=map(int, input().split()) map(int, input().split()) k def fac_and_inv() :
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, uplimit) :
        fac[i] = fac[i-1] * i % MOD
        inv[i] = MOD - inv[MOD%i] * int(MOD / i) % MOD
        finv[i] = finv[i-1] * inv[i] % MOD
    return fac, finv, inv def fac_and_inv() :
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, uplimit) :
        fac[i] = fac[i-1] * i % MOD
        inv[i] = MOD - inv[MOD%i] * int(MOD / i) % MOD
        finv[i] = finv[i-1] * inv[i] % MOD
    return fac, finv, inv fac_and_inv finv = [0 for i in range(uplimit)] [0 for i in range(uplimit)] finv MOD=10**9+7 10**9+7 MOD temp = fac_and_inv() fac_and_inv() temp
n,k=map(int, input().split())  
MOD=10**9+7
uplimit=2*10**5+1
fac = [0 for i in range(uplimit)] # 階乗
inv = [0 for i in range(uplimit)] # iの逆元 
finv = [0 for i in range(uplimit)] # i!の逆元

def fac_and_inv() :
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, uplimit) :
        fac[i] = fac[i-1] * i % MOD
        inv[i] = MOD - inv[MOD%i] * int(MOD / i) % MOD
        finv[i] = finv[i-1] * inv[i] % MOD
    return fac, finv, inv

temp = fac_and_inv()
ans = 0

#  x : 0人部屋の数
for x in range(0, k+1) : # k回動ける=最大kまで0人部屋になりうる
    if(x >= n) : # kがn以上の場合を想定。これ以降は計算する意味なし。
        break
    y = n - x # y : 人がいる部屋の数
    ans += (fac[n]*finv[x]*finv[n-x]) * (fac[n-1] * finv[x] * finv[y-1]) % MOD
    # 要はnCx * n-xHx 通り
    # nCxは0人部屋の選び方
    # n-xHxは n-xから重複を許してx選ぶ組み合わせ
    # n-xHx = n-1Cn-x-1 = n-1Cy-1
    # よって(n-1)! / x! / (y-1)!が欲しい

print(ans % MOD)

