n,k = map(int,input().split())
MOD = 10**9+7

FAC = [1]
INV = [1]
for i in range(1,2*n+1):
  FAC.append((FAC[i-1]*i) % MOD)
  INV.append(pow(FAC[-1],MOD-2,MOD))

def nCr(n,r):
  return FAC[n]*INV[n-r]*INV[r]

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

FAC = [1]
INV = [1]
for i in range(1,2*n+1):
  FAC.append((FAC[i-1]*i) % MOD)
  INV.append(pow(FAC[-1],MOD-2,MOD))

def nCr(n,r):
  return FAC[n]*INV[n-r]*INV[r]

ans = 0
for i in range(min(n-1,k)+1):
  ans += nCr(n,i)*nCr(n-1,n-i-1)
  ans %= MOD
print(ans)
