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

MOD = int(1e+9+7)

max_zero_num = min(n-1, k)
kai = [1]*(n+1)
gyaku_kai = [1]*(n+1)

for i in range(n):
    kai[i+1] = kai[i]*(i+1) % MOD
    gyaku_kai[i+1] = pow(kai[i+1], MOD-2, MOD)%MOD
        
answer = 0
for zero_num in range(max_zero_num+1):
    answer = (answer + kai[n]*gyaku_kai[n-zero_num]*gyaku_kai[zero_num]*\
    kai[n-1]*gyaku_kai[n-1-zero_num]*gyaku_kai[zero_num]) %MOD

print(answer) n, k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k MOD = int(1e+9+7) MOD int(1e+9+7) int 1e+9+7 1e+9 7 max_zero_num = min(n-1, k) max_zero_num min(n-1, k) min n-1 n 1 k kai = [1]*(n+1) kai [1]*(n+1) [1] 1 n+1 n 1 gyaku_kai = [1]*(n+1) gyaku_kai [1]*(n+1) [1] 1 n+1 n 1 for i in range(n):
    kai[i+1] = kai[i]*(i+1) % MOD
    gyaku_kai[i+1] = pow(kai[i+1], MOD-2, MOD)%MOD
         i range(n) range n kai[i+1] = kai[i]*(i+1) % MOD kai[i+1] kai i+1 i 1 kai[i]*(i+1) % MOD kai[i]*(i+1) kai[i] kai i i+1 i 1 MOD gyaku_kai[i+1] = pow(kai[i+1], MOD-2, MOD)%MOD gyaku_kai[i+1] gyaku_kai i+1 i 1 pow(kai[i+1], MOD-2, MOD)%MOD pow(kai[i+1], MOD-2, MOD) pow kai[i+1] kai i+1 i 1 MOD-2 MOD 2 MOD MOD answer = 0 answer 0 for zero_num in range(max_zero_num+1):
    answer = (answer + kai[n]*gyaku_kai[n-zero_num]*gyaku_kai[zero_num]*\
    kai[n-1]*gyaku_kai[n-1-zero_num]*gyaku_kai[zero_num]) %MOD zero_num range(max_zero_num+1) range max_zero_num+1 max_zero_num 1 answer = (answer + kai[n]*gyaku_kai[n-zero_num]*gyaku_kai[zero_num]*\
    kai[n-1]*gyaku_kai[n-1-zero_num]*gyaku_kai[zero_num]) %MOD answer (answer + kai[n]*gyaku_kai[n-zero_num]*gyaku_kai[zero_num]*\
    kai[n-1]*gyaku_kai[n-1-zero_num]*gyaku_kai[zero_num]) %MOD answer + kai[n]*gyaku_kai[n-zero_num]*gyaku_kai[zero_num]*\
    kai[n-1]*gyaku_kai[n-1-zero_num]*gyaku_kai[zero_num] answer kai[n]*gyaku_kai[n-zero_num]*gyaku_kai[zero_num]*\
    kai[n-1]*gyaku_kai[n-1-zero_num]*gyaku_kai[zero_num] kai[n]*gyaku_kai[n-zero_num]*gyaku_kai[zero_num]*\
    kai[n-1]*gyaku_kai[n-1-zero_num] kai[n]*gyaku_kai[n-zero_num]*gyaku_kai[zero_num]*\
    kai[n-1] kai[n]*gyaku_kai[n-zero_num]*gyaku_kai[zero_num] kai[n]*gyaku_kai[n-zero_num] kai[n] kai n gyaku_kai[n-zero_num] gyaku_kai n-zero_num n zero_num gyaku_kai[zero_num] gyaku_kai zero_num kai[n-1] kai n-1 n 1 gyaku_kai[n-1-zero_num] gyaku_kai n-1-zero_num n-1 n 1 zero_num gyaku_kai[zero_num] gyaku_kai zero_num MOD print(answer) print answer answer = 0 0 answer n, k = map(int, input().split()) map(int, input().split()) n MOD = int(1e+9+7) int(1e+9+7) MOD answer = (answer + kai[n]*gyaku_kai[n-zero_num]*gyaku_kai[zero_num]*\
    kai[n-1]*gyaku_kai[n-1-zero_num]*gyaku_kai[zero_num]) %MOD (answer + kai[n]*gyaku_kai[n-zero_num]*gyaku_kai[zero_num]*\
    kai[n-1]*gyaku_kai[n-1-zero_num]*gyaku_kai[zero_num]) %MOD answer max_zero_num = min(n-1, k) min(n-1, k) max_zero_num kai = [1]*(n+1) [1]*(n+1) kai gyaku_kai = [1]*(n+1) [1]*(n+1) gyaku_kai k = map(int, input().split()) map(int, input().split()) k
n, k = map(int, input().split())

MOD = int(1e+9+7)

max_zero_num = min(n-1, k)
kai = [1]*(n+1)
gyaku_kai = [1]*(n+1)

for i in range(n):
    kai[i+1] = kai[i]*(i+1) % MOD
    gyaku_kai[i+1] = pow(kai[i+1], MOD-2, MOD)%MOD
        
answer = 0
for zero_num in range(max_zero_num+1):
    answer = (answer + kai[n]*gyaku_kai[n-zero_num]*gyaku_kai[zero_num]*\
    kai[n-1]*gyaku_kai[n-1-zero_num]*gyaku_kai[zero_num]) %MOD

print(answer)
