n,k = map(int,input().split())
m = min(k,n-1)
mod = 10**9+7

A = [0]*(m+1)
B = [0]*(m+1)

for i in range(m+1):
    if i == 0:
        A[0] = 1
        B[0] = 1
    else:
        A[i] = ((A[i-1]*(n-i+1))*pow(i,mod-2,mod)) % mod
        B[i] = ((B[i-1]*(n-i))*pow(i,mod-2,mod)) % mod

ans = 0
for i in range(m+1):
    ans = (ans+A[i]*B[i]) % mod

print(ans % mod) n,k = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split k m = min(k,n-1) m min(k,n-1) min k n-1 n 1 mod = 10**9+7 mod 10**9+7 10**9 10 9 7 A = [0]*(m+1) A [0]*(m+1) [0] 0 m+1 m 1 B = [0]*(m+1) B [0]*(m+1) [0] 0 m+1 m 1 for i in range(m+1):
    if i == 0:
        A[0] = 1
        B[0] = 1
    else:
        A[i] = ((A[i-1]*(n-i+1))*pow(i,mod-2,mod)) % mod
        B[i] = ((B[i-1]*(n-i))*pow(i,mod-2,mod)) % mod i range(m+1) range m+1 m 1 if i == 0:
        A[0] = 1
        B[0] = 1
    else:
        A[i] = ((A[i-1]*(n-i+1))*pow(i,mod-2,mod)) % mod
        B[i] = ((B[i-1]*(n-i))*pow(i,mod-2,mod)) % mod i == 0 i 0 A[0] = 1 A[0] A 0 1 B[0] = 1 B[0] B 0 1 A[i] = ((A[i-1]*(n-i+1))*pow(i,mod-2,mod)) % mod A[i] A i ((A[i-1]*(n-i+1))*pow(i,mod-2,mod)) % mod (A[i-1]*(n-i+1))*pow(i,mod-2,mod) A[i-1]*(n-i+1) A[i-1] A i-1 i 1 n-i+1 n-i n i 1 pow(i,mod-2,mod) pow i mod-2 mod 2 mod mod B[i] = ((B[i-1]*(n-i))*pow(i,mod-2,mod)) % mod B[i] B i ((B[i-1]*(n-i))*pow(i,mod-2,mod)) % mod (B[i-1]*(n-i))*pow(i,mod-2,mod) B[i-1]*(n-i) B[i-1] B i-1 i 1 n-i n i pow(i,mod-2,mod) pow i mod-2 mod 2 mod mod ans = 0 ans 0 for i in range(m+1):
    ans = (ans+A[i]*B[i]) % mod i range(m+1) range m+1 m 1 ans = (ans+A[i]*B[i]) % mod ans (ans+A[i]*B[i]) % mod ans+A[i]*B[i] ans A[i]*B[i] A[i] A i B[i] B i mod print(ans % mod) print ans % mod ans mod ans = (ans+A[i]*B[i]) % mod (ans+A[i]*B[i]) % mod ans n,k = map(int,input().split()) map(int,input().split()) n k = map(int,input().split()) map(int,input().split()) k B = [0]*(m+1) [0]*(m+1) B m = min(k,n-1) min(k,n-1) m A = [0]*(m+1) [0]*(m+1) A mod = 10**9+7 10**9+7 mod ans = 0 0 ans
n,k = map(int,input().split())
m = min(k,n-1)
mod = 10**9+7

A = [0]*(m+1)
B = [0]*(m+1)

for i in range(m+1):
    if i == 0:
        A[0] = 1
        B[0] = 1
    else:
        A[i] = ((A[i-1]*(n-i+1))*pow(i,mod-2,mod)) % mod
        B[i] = ((B[i-1]*(n-i))*pow(i,mod-2,mod)) % mod

ans = 0
for i in range(m+1):
    ans = (ans+A[i]*B[i]) % mod

print(ans % mod)