N,K=map(int, raw_input().split())
 
mod=10**9+7
fact, inv_fact = [1], [1]
fact_tmp = 1
for i in range(1,N+1):
    fact_tmp *= i
    fact_tmp %= mod
    fact.append(fact_tmp)
    inv_fact.append(pow(fact_tmp, mod-2, mod))
 
def ncr(n,r):
	if n < 0 or r < 0 or n < r:	return 0
	else:	return (fact[n] * inv_fact[r] * inv_fact[n-r]) %mod

can_zero_num=min(N-1,K)
ans=0
for zero_num in range(can_zero_num+1):
    ans+=ncr(N,zero_num)*ncr(N-1,N-zero_num-1)

print ans%mod N,K=map(int, raw_input().split()) N map(int, raw_input().split()) map int raw_input().split() ().split () raw_input split K mod=10**9+7 mod 10**9+7 10**9 10 9 7 fact, inv_fact = [1], [1] fact [1] 1 inv_fact [1] 1 fact_tmp = 1 fact_tmp 1 for i in range(1,N+1):
    fact_tmp *= i
    fact_tmp %= mod
    fact.append(fact_tmp)
    inv_fact.append(pow(fact_tmp, mod-2, mod))
  i range(1,N+1) range 1 N+1 N 1 fact_tmp *= i fact_tmp i fact_tmp %= mod fact_tmp mod fact.append(fact_tmp) fact.append fact append fact_tmp inv_fact.append(pow(fact_tmp, mod-2, mod)) inv_fact.append inv_fact append pow(fact_tmp, mod-2, mod) pow fact_tmp mod-2 mod 2 mod def ncr(n,r):
	if n < 0 or r < 0 or n < r:	return 0
	else:	return (fact[n] * inv_fact[r] * inv_fact[n-r]) %mod ncr if n < 0 or r < 0 or n < r:	return 0
	else:	return (fact[n] * inv_fact[r] * inv_fact[n-r]) %mod n < 0 or r < 0 or n < r n < 0 or r < 0 n < 0 n 0 r < 0 r 0 n < r n r n n r r can_zero_num=min(N-1,K) can_zero_num min(N-1,K) min N-1 N 1 K ans=0 ans 0 for zero_num in range(can_zero_num+1):
    ans+=ncr(N,zero_num)*ncr(N-1,N-zero_num-1) zero_num range(can_zero_num+1) range can_zero_num+1 can_zero_num 1 ans+=ncr(N,zero_num)*ncr(N-1,N-zero_num-1) ans ncr(N,zero_num)*ncr(N-1,N-zero_num-1) ncr(N,zero_num) ncr N zero_num ncr(N-1,N-zero_num-1) ncr N-1 N 1 N-zero_num-1 N-zero_num N zero_num 1 print ans%mod ans mod fact_tmp = 1 1 fact_tmp N,K=map(int, raw_input().split()) map(int, raw_input().split()) N mod=10**9+7 10**9+7 mod inv_fact = [1], [1] [1] inv_fact fact_tmp %= mod mod fact_tmp can_zero_num=min(N-1,K) min(N-1,K) can_zero_num ans+=ncr(N,zero_num)*ncr(N-1,N-zero_num-1) ncr(N,zero_num)*ncr(N-1,N-zero_num-1) ans ans=0 0 ans K=map(int, raw_input().split()) map(int, raw_input().split()) K fact, inv_fact = [1], [1] [1] fact fact_tmp *= i i fact_tmp def ncr(n,r):
	if n < 0 or r < 0 or n < r:	return 0
	else:	return (fact[n] * inv_fact[r] * inv_fact[n-r]) %mod def ncr(n,r):
	if n < 0 or r < 0 or n < r:	return 0
	else:	return (fact[n] * inv_fact[r] * inv_fact[n-r]) %mod ncr
N,K=map(int, raw_input().split())
 
mod=10**9+7
fact, inv_fact = [1], [1]
fact_tmp = 1
for i in range(1,N+1):
    fact_tmp *= i
    fact_tmp %= mod
    fact.append(fact_tmp)
    inv_fact.append(pow(fact_tmp, mod-2, mod))
 
def ncr(n,r):
	if n < 0 or r < 0 or n < r:	return 0
	else:	return (fact[n] * inv_fact[r] * inv_fact[n-r]) %mod

can_zero_num=min(N-1,K)
ans=0
for zero_num in range(can_zero_num+1):
    ans+=ncr(N,zero_num)*ncr(N-1,N-zero_num-1)

print ans%mod