N,K=map(int,input().split())
mod=10**9+7

def cmb(n,r):
  global mod
  if r<0 or r>n:
    return 0
  return (g1[n]*g2[r]*g2[n-r])%mod

g1=[1,1]
g2=[1,1]
inv=[0,1]
for i in range(2,1000003):
  g1.append((g1[-1]*i)%mod)
  inv.append((-inv[mod%i]*(mod//i))%mod)
  g2.append((g2[-1]*inv[-1])%mod)
P=0
for i in range(min(N,K+1)):
  P=(P+cmb(N,i)*cmb(N-1,i))%mod
print(P) 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 def cmb(n,r):
  global mod
  if r<0 or r>n:
    return 0
  return (g1[n]*g2[r]*g2[n-r])%mod cmb global mod if r<0 or r>n:
    return 0
   r<0 or r>n r<0 r 0 r>n r n return 0 0 return (g1[n]*g2[r]*g2[n-r])%mod (g1[n]*g2[r]*g2[n-r])%mod g1[n]*g2[r]*g2[n-r] g1[n]*g2[r] g1[n] g1 n g2[r] g2 r g2[n-r] g2 n-r n r mod n n r r g1=[1,1] g1 [1,1] 1 1 g2=[1,1] g2 [1,1] 1 1 inv=[0,1] inv [0,1] 0 1 for i in range(2,1000003):
  g1.append((g1[-1]*i)%mod)
  inv.append((-inv[mod%i]*(mod//i))%mod)
  g2.append((g2[-1]*inv[-1])%mod) i range(2,1000003) range 2 1000003 g1.append((g1[-1]*i)%mod) g1.append g1 append (g1[-1]*i)%mod g1[-1]*i g1[-1] g1 -1 i mod inv.append((-inv[mod%i]*(mod//i))%mod) inv.append inv append (-inv[mod%i]*(mod//i))%mod -inv[mod%i]*(mod//i) -inv[mod%i] inv[mod%i] inv mod%i mod i mod//i mod i mod g2.append((g2[-1]*inv[-1])%mod) g2.append g2 append (g2[-1]*inv[-1])%mod g2[-1]*inv[-1] g2[-1] g2 -1 inv[-1] inv -1 mod P=0 P 0 for i in range(min(N,K+1)):
  P=(P+cmb(N,i)*cmb(N-1,i))%mod i range(min(N,K+1)) range min(N,K+1) min N K+1 K 1 P=(P+cmb(N,i)*cmb(N-1,i))%mod P (P+cmb(N,i)*cmb(N-1,i))%mod P+cmb(N,i)*cmb(N-1,i) P cmb(N,i)*cmb(N-1,i) cmb(N,i) cmb N i cmb(N-1,i) cmb N-1 N 1 i mod print(P) print P P=(P+cmb(N,i)*cmb(N-1,i))%mod (P+cmb(N,i)*cmb(N-1,i))%mod P def cmb(n,r):
  global mod
  if r<0 or r>n:
    return 0
  return (g1[n]*g2[r]*g2[n-r])%mod def cmb(n,r):
  global mod
  if r<0 or r>n:
    return 0
  return (g1[n]*g2[r]*g2[n-r])%mod cmb g1=[1,1] [1,1] g1 g2=[1,1] [1,1] g2 mod=10**9+7 10**9+7 mod P=0 0 P inv=[0,1] [0,1] inv K=map(int,input().split()) map(int,input().split()) K N,K=map(int,input().split()) map(int,input().split()) N
N,K=map(int,input().split())
mod=10**9+7

def cmb(n,r):
  global mod
  if r<0 or r>n:
    return 0
  return (g1[n]*g2[r]*g2[n-r])%mod

g1=[1,1]
g2=[1,1]
inv=[0,1]
for i in range(2,1000003):
  g1.append((g1[-1]*i)%mod)
  inv.append((-inv[mod%i]*(mod//i))%mod)
  g2.append((g2[-1]*inv[-1])%mod)
P=0
for i in range(min(N,K+1)):
  P=(P+cmb(N,i)*cmb(N-1,i))%mod
print(P)