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

f = [1]
fi = [1]
for i in range(n):
    f.append(f[i]*(i+1) % mod)
    fi.append(pow(f[i+1], mod-2, mod))

def comb_mod(n, r, mod):
    return f[n] * fi[r] * fi[n-r] % mod

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

f = [1]
fi = [1]
for i in range(n):
    f.append(f[i]*(i+1) % mod)
    fi.append(pow(f[i+1], mod-2, mod))

def comb_mod(n, r, mod):
    return f[n] * fi[r] * fi[n-r] % mod

for m in range(m+1):
    ans += comb_mod(n, m, mod) * comb_mod(n-1, m, mod) % mod

print(ans%mod)